File Input Output - Study Mode

[#226] What will be the output of the following C code? char str[] = "Hello Nancy“
printf(“
%.7s”, str)
Correct Answer

(C) Hello N

[#227] What will be the output of the following C code? #include <stdio.h>
int main(int argc, char **argv)
{
char *s = "myworld"
int i = 3
printf("%10.*s", i, s)
}
Correct Answer

(A) myw(note:7 spaces before myw)

[#228] What is the prototype of scanf function?
Correct Answer

(A) scanf("controlstring",arg1,arg2,arg3,....,argn)

[#229] What will be the output of the following C code? #include <stdio.h>
#include <math.h>
int main()
{
int i = 90
printf("%f
", sin(i))
return 0
}
Correct Answer

(C) 0.893997

[#230] What will be the output of the following C code? #include <stdio.h>
int main()
{
int i = 10, j = 3, k = 3
printf("%d %d ", i, j, k)
}
Correct Answer

(C) 10 3
(G) 10 3