int main ()
{
int a = 10;
if (a == a--)
printf ("TRUE 1 t");
a = 10;
if (a == --a)
printf ("TRUE 2 t");
}
A - TRUE 1
B - TRUE 2
C - TRUE 1 TRUE 2
D - No output
Question 11: Where is a valid C expression?
A - int my_num = 100,000
B - int my_num = 100000
C - int my num = 1000
D- int $ my_num = 10000
Question 12: This is the output of the following code:
#include
int main ()
{
printf ("TipsMake.com!% dn", x);
return 0;
}
A - TipsMake.com! x
B - TipsMake.com! with junk worth going after
C - Compilation error
D - TipsMake.com!
Question 13: What happens if the following code is executed?
#include
int main ()
{
int main = 3;
printf ("% d", main);
return 0;
}
A - Create compilation error
B - Generate runtime error
C - It will run without error and print 3 to the screen
D - It will create an infinite loop
Question 14: This is the output of the following code:
#include
int main ()
{
char chr;
chr = 128;
printf ("% dn", chr);
return 0;
}
A - 128
B - -128
C - Depending on the compiler
D - There is no right answer
Question 15: This is the output of the following code:
#include
int main ()
{
char * p [1] = {"TipsMake.com"};
printf ("% s", (p) [0]);
return 0;
}
A - Compilation error
B - Unknown error
C - TipsMake.com
D - No answer right
Question 16: This is the output of the following code C:
#include
int main ()
{
printf ("quantrimang.comn");
return 0;
}
A - quantrimang.com
B - quantrimang.
code
C - comquantrimang.
D - quantrimang.
Question 17: Which of the following is not a logical or relational operator?
A -! =
B - ==
C - ||
D - =
Question 18: The scope of an automatic variable is:
A - In the block it appears
B - In the block of the block it appears
C - Until the end of the program
D - Both A and B
Question 19: Is the default storage layer automatic if not specified for a local variable?
A - True
B - False
C - Depends on standards
D - Not mentioned
Question 20: What is the scope of an external variable?
A - The entire source file in which the variable is defined
B - From the declaration point to the end of the file in which the variable is defined
C - Any source file in the program
D - From the declaration point to the end of the file being compiled
Answer:
1. A 2. C 3. C 4. D 5. B 6. A 7. B 8. B 9. C 10. B 11. B 12. C 13. C 14. B 15. C 16. A 17. D 18. D 19. A 20. DGood luck!