Global Soft Computer Technology
Global Soft Computer Technology
------------------------------------------------------------------------------------------------------------------
-
#include <stdio.h>
int main()
{
float q = ‘a’;
printf(“%f”, q);
return 0;
}
a. run time error
b. a
c. 97.000000
d. a.0000000
#include<stdio.h>
int main()
{
int p = 1, q = 2, r = 3, s = 4, x;
e = r + s = q * p;
printf(“%d, %d\n”, x, s);
}
a. Syntax error
b. 5, 2
c. 7, 2
d. 7, 4
a. External
b. Internal
c. Both External and Internal
d. None of the above
a. Inclusion directive
a.
int sum(int x, int y)
return (x + y);
b.
{return (x + y);}
c.
int sum(x, y)
return (x + y);
1. #include <stdio.h>
2. int main()
3. {
4. int y = 10000;
5. int y = 34;
6. printf("Hello World! %d\n", y);
7. return 0;
8. }
a) Compile time error
b) Hello World! 34
c) Hello World! 1000
d) Hello World! followed by a junk value
1. #include <stdio.h>
2. void main()
3. {
4. int x = 5 * 9 / 3 + 9;
5. }
a) 3.75
b) Depends on compiler
c) 24
d) 3
1. #include <stdio.h>
2. void reverse(int i);
3. int main()
4. {
5. reverse(1);
6. }
7. void reverse(int i)
8. {
9. if (i > 5)
10. return ;
11. printf("%d ", i);
12. return reverse((i++, i));
13. }
a) 1 2 3 4 5
b) Segmentation fault
c) Compilation error
d) Undefined behaviour