Programming for Problem Solving MCQs | Page - 4
Dear candidates you will find MCQ questions of Programming for Problem Solving here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Q. What is storage class for variable A in below code?
int main()
{
int A;
A = 10;
printf("%d", A);
return 0;
}
β
Correct Answer: (B)
auto
Q. #include "stdio.h"
int main()
{
int a@ = 10;
printf("%d", a@);
return 0;
}
β
Correct Answer: (D)
[Error] stray '@' in program
Q. #include "stdio.h"
int main()
{
int a = 10;
printf("%d", a);
int a = 20;
printf("%d",a);
return 0;
}
β
Correct Answer: (B)
Error: Redeclartion of a
Q. #include "stdio.h"
int a = 20;
int main()
{
int a = 10;
printf("%d", ::a);
return 0;
}
β
Correct Answer: (B)
20
Q. #include "stdio.h"
int main()
{
int a = 10, b = 20;
if(a=b)
{
printf("Easy");
}
else
{
printf("Hard");
}
return 0;
}
β
Correct Answer: (A)
Easy
Q. Which gcc flag is used to enable all Compiler warnings?
β
Correct Answer: (C)
gcc -Wall
Q. Which gcc flag is used to generate maximum debug information?
β
Correct Answer: (D)
gcc –g3
Q. Which macro is used to insert assembly code in C program (VC++ compiler)?
β
Correct Answer: (C)
__asm
Q. Which macro is used to insert assembly code in C program (GCC compiler)?
β
Correct Answer: (A)
__asm__
Jump to