File Input Output - Study Mode

[#266] What will be the output of the following C code? #include <stdio.h>
#include <stdarg.h>
void func(int, ...)
int main()
{
func(2, 3, 5, 7, 11, 13)
return 0
}
void func(int n, ...)
{
int number, i = 0
va_list start
va_start(start, n)
while (i != 3)
{
number = va_arg(start, int)
i++
}
printf("%d", number)
}
Correct Answer

(C) 7

[#267] What will be the output of the following C code? #include <stdio.h>
int main()
{
char n[] = "hello
world!"
char s[13]
sscanf(n, "%s", s)
printf("%s
", s)
return 0
}
Correct Answer

(C) hello

[#268] What will be the output of the following C code? #include <stdio.h>
#include <ctype.h>
int main()
{
int i = 32
if (isspace(i))
printf("space
")
else
printf("not space
")
return 0
}
Correct Answer

(B) space

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

(B) Undefined behaviour

[#270] What will be the output of the following C code? #include <stdio.h>
int main()
{
char i = '9'
if (isdigit(i))
printf("digit
")
else
printf("not digit
")
return 0
}
Correct Answer

(A) digit