0% found this document useful (0 votes)
7K views

Programming For Problem Solving Set 2

This document contains 50 multiple choice questions about programming in C. The questions cover topics like C keywords, data types, operators, loops, functions, libraries, variable scope, and more. Each question is followed by 4 possible answers with the correct answer indicated. The questions progressively increase in complexity, testing understanding of basic concepts initially and more advanced ideas later.

Uploaded by

Md. Al Mamun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7K views

Programming For Problem Solving Set 2

This document contains 50 multiple choice questions about programming in C. The questions cover topics like C keywords, data types, operators, loops, functions, libraries, variable scope, and more. Each question is followed by 4 possible answers with the correct answer indicated. The questions progressively increase in complexity, testing understanding of basic concepts initially and more advanced ideas later.

Uploaded by

Md. Al Mamun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Programming for Problem Solving MCQs

[set-2]

26. Total Number Of Keywords In C Are


A. 30
B. 12
C. 34
D. 32
Answer: D

27. The Compiler In C Ignores All Text Till The End Of Line Using
A. //
o m
B. /
. c
C. */
te
D. /*/
a
Answer: A

q M
c Of C
28. Printf() Belongs To Which Library
A. Stdlib.H M
B. Stdio.H
C. Stdout.H
D. Stdoutput.H
Answer: B

29. What Is Correct Order Of Precedence In C


A. Addition, Division, Modulus
B. Addition, Modulus, Division
C. Multiplication, Substration, Modulus
D. Modulus, Multiplication, Substration
Answer: D

30. In Switch Statement, Each Case Instance Value Must Be _______?


A. Constant
B. Variable
C. Special Symbol
D. None Of The Above
Answer: A

31. What Is The Work Of Break Keyword?


A. Halt Execution Of Program
B. Restart Execution Of Program
C. Exit From Loop Or Switch Statement
D. all
Answer: C

32. Which One Of The Following Sentences Is True ?


A. The Body Of A While Loop Is Executed At Least Once.
B. The Body Of A Do ... While Loop Is Executed At Least Once.
C. The Body Of A Do ... While Loop Is Executed Zero Or More Times.
D. A For Loop Can Never Be Used In Place Of A While Loop.
Answer: B

33. A C Variable Cannot Start With


A. An Alphabet
B. A Number
C. A Special Symbol Other Than Underscore
D. Both (B) And (C)
Answer: D

34. Which Of The Following Shows The Correct Hierarchy Of Arithmetic


Operations In C
A. / + * -
B. * - / +
C. + - / *
D. * / + -
Answer: D

35. Int Main()


{
Extern Int I;
I = 20;
Printf("%D", Sizeof(I));

View all MCQ's at McqMate.com


Return 0;
}
A. 20
B. 0
C. Undefined Reference To I
D. Linking Error
Answer: C

36. Is The Following Statement A Declaration Or Definition Extern Int I;


A. Declaration
B. Definition
C. none
D. all
Answer: A

37. Int Main()


{
Int X = 10;
{
Int X = 0;
Printf("%D",X);
}
Return 0;
}
A. 10
B. Compilation Error
C. '0'
D. Undefined
Answer: C

38. //This Program Is Compiled On 32 Bit DEV-C++


Int Main()
{
Char *Ptr1, *Ptr2;
Printf("%D %D", Sizeof(Ptr1), Sizeof(Ptr2));
Return 0;
}

View all MCQ's at McqMate.com


A. 1 1
B. 2 2
C. 4 4
D. none
Answer: C

39. What Should Be The Output:


Int Main()
{
Int A = 10/3;
Printf("%D",A);
Return 0;
}
A. 3.33
B. 3.0
C. 3
D. Option.
Answer: C

40. Which Of The Following Is Executed By Preprocess?


A. #Include<Stdio.H>
B. Return 0
C. Void Main(Int Argc , Char ** Argv)
D. none
Answer: A

41. Int Main()


{
Int A = 10.5;
Printf("%D",A);
Return 0;
}
A. 10.5
B. 10.0
C. 10
D. Compilation Error
Answer: C

View all MCQ's at McqMate.com


42. Int Main()
{
Int _ = 10;
Int __ = 20;
Int ___ = _ + __;
Printf("__%D",___);
Return 0;
}
A. Compilation Error
B. Runtime Error
C. __0
D. __30
Answer: D

43. Int Main()


{
Int A = 5;
Int B = 10;
Int C = A+B;
Printf("%I",C);
A. 0
B. 15
C. Undefined I
D. Any Other Compiler Error
Answer: B

44. int main()


{
int x;
x=10,20,30;
printf("%d",x);
return 0;
}
A. 10
B. 20
C. 30

View all MCQ's at McqMate.com


D. Compilation Error
Answer: A

45. How many times C.com is printed?


int main()
{
int a = 0;
while(a++ < 5-++a)
printf("C.com");
return 0;
}
A. 5 times
B. 4 times
C. 3 times
D. 1 times
Answer: D

46. How many times C.com is printed?


int main()
{
int a = 0;
while(a++ < 5)
printf("C.com");
return 0;
}
A. 5 times
B. 4 times
C. 3 times
D. 1 times
Answer: A

47. How many times C.com is printed?


int main()
{
int a = 0;
while(a++)
printf("C.com");

View all MCQ's at McqMate.com


return 0;
}
A. 1 time
B. 0 time
C. Infinite times(Untill Stack is overflow)
D. 2 times
Answer: B

48. How many times C.com is printed?


int main()
{
int a = 0;
while(++a)
{
printf("C.com");
}
return 0;
}
A. 1 time
B. Infinite Times(Untill Stack is overflow)
C. 2 times
D. Error
Answer: B

49. 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);

View all MCQ's at McqMate.com


return 0;
}
A. 55
B. 54
C. 1
D. 0
Answer: C

50. 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;
}
A. 5
B. 10
C. 25
D. 50
Answer: C

View all MCQ's at McqMate.com

You might also like