File Input Output - Study Mode

[#251] What will be the output of the following C code? #include <stdio.h>
#include <math.h>
void main()
{
int k = pow(2, 3)
printf("%d
", k)
}
Correct Answer

(B) 8

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

(B) myworld(note: spaces to the left of myworld)

[#253] Which of the following is an invalid method for input?
Correct Answer

(D) none of the mentioned

[#254] Which among the following is correct function call for rand() and random()?
Correct Answer

(A) rand() and random()

[#255] What will be the output of the following C code? #include <stdio.h>
#include <stdarg.h>
int f(char c, ...)
int main()
{
char c = 97, d = 98
f(c, d)
return 0
}
int f(char c, ...)
{
va_list li
va_start(li, c)
char d = va_arg(li, int)
printf("%c
", d)
va_end(li)
}
Correct Answer

(D) b