Programming For Problem Solving Set 2

On This Page

This set of Programming for Problem Solving Multiple Choice Questions & Answers (MCQs) focuses on Programming For Problem Solving Set 2

Q1 | Total Number Of Keywords In C Are
  • 30
  • 12
  • 34
  • 32
Q2 | The Compiler In C Ignores All Text Till The End Of Line Using
  • //
  • /
  • */
  • /*/
Q3 | Printf() Belongs To Which Library Of C
  • Stdlib.H
  • Stdio.H
  • Stdout.H
  • Stdoutput.H
Q4 | What Is Correct Order Of Precedence In C
  • Addition, Division, Modulus
  • Addition, Modulus, Division
  • Multiplication, Substration, Modulus
  • Modulus, Multiplication, Substration
Q5 | In Switch Statement, Each Case Instance Value Must Be _______?
  • Constant
  • Variable
  • Special Symbol
  • None Of The Above
Q6 | What Is The Work Of Break Keyword?
  • Halt Execution Of Program
  • Restart Execution Of Program
  • Exit From Loop Or Switch Statement
  • all
Q7 | Which One Of The Following Sentences Is True ?
  • The Body Of A While Loop Is Executed At Least Once.
  • The Body Of A Do ... While Loop Is Executed At Least Once.
  • The Body Of A Do ... While Loop Is Executed Zero Or More Times.
  • A For Loop Can Never Be Used In Place Of A While Loop.
Q8 | A C Variable Cannot Start With
  • An Alphabet
  • A Number
  • A Special Symbol Other Than Underscore
  • Both (B) And (C)
Q9 | Which Of The Following Shows The Correct Hierarchy Of Arithmetic Operations In C
  • / + * -
  • * - / +
  • + - / *
  • * / + -
Q10 | Int Main(){Extern Int I;I = 20;Printf("%D", Sizeof(I));Return 0;}
  • 20
  • 0
  • Undefined Reference To I
  • Linking Error
Q11 | Is The Following Statement A Declaration Or DefinitionExtern Int I;
  • Declaration
  • Definition
  • none
  • all
Q12 | Int Main(){Int X = 10;{Int X = 0;Printf("%D",X);}Return 0;}
  • 10
  • Compilation Error
  • '0'
  • Undefined
Q13 | //This Program Is Compiled On 32 Bit DEV-C++Int Main(){Char *Ptr1, *Ptr2;Printf("%D %D", Sizeof(Ptr1), Sizeof(Ptr2));Return 0;}
  • 1 1
  • 2 2
  • 4 4
  • none
Q14 | What Should Be The Output:Int Main(){Int A = 10/3;Printf("%D",A);Return 0;}
  • 3.33
  • 3.0
  • 3
  • Option.
Q15 | Which Of The Following Is Executed By Preprocess?
  • #Include
  • Return 0
  • Void Main(Int Argc , Char ** Argv)
  • none
Q16 | Int Main(){Int A = 10.5;Printf("%D",A);Return 0;}
  • 10.5
  • 10.0
  • 10
  • Compilation Error
Q17 | Int Main(){Int _ = 10;Int __ = 20;Int ___ = _ + __;Printf("__%D",___);Return 0;}
  • Compilation Error
  • Runtime Error
  • __0
  • __30
Q18 | Int Main(){Int A = 5;Int B = 10;Int C = A+B;Printf("%I",C);
  • 0
  • 15
  • Undefined I
  • Any Other Compiler Error
Q19 | int main(){int x;x=10,20,30;printf("%d",x);return 0;}
  • 10
  • 20
  • 30
  • Compilation Error
Q20 | How many times C.com is printed?int main(){int a = 0;while(a++ < 5-++a)printf("C.com");return 0;}
  • 5 times
  • 4 times
  • 3 times
  • 1 times
Q21 | How many times C.com is printed?int main(){int a = 0;while(a++ < 5)printf("C.com");return 0;}
  • 5 times
  • 4 times
  • 3 times
  • 1 times
Q22 | How many times C.com is printed?int main(){int a = 0;while(a++)printf("C.com");return 0;}
  • 1 time
  • 0 time
  • Infinite times(Untill Stack is overflow)
  • 2 times
Q23 | How many times C.com is printed?int main(){int a = 0;while(++a){printf("C.com");}return 0;}
  • 1 time
  • Infinite Times(Untill Stack is overflow)
  • 2 times
  • Error
Q24 | What is output of below program?int main(){int i,j,count;count=0;for(i=0; i<5; i++);{for(j=0;j<5;j++);{count++;}}printf("%d",count);return 0;}
  • 55
  • 54
  • 1
Q25 | What is output of below program?int main(){int i,j,k,count;count=0;for(i=0;i<5;i++){for(j=0;j<5;j++){count++;}}printf("%d",count);return 0;}
  • 5
  • 10
  • 25
  • 50