File Input Output - Study Mode

[#181] What will be the output of the following C code? #include <stdio.h>
int main()
{
char str[10] = "hello"

char *p = strrchr(str, 'l')

printf("%c
", *(++p))

}
Correct Answer

(B) o

[#182] What will be the output of the following C code? #include <stdio.h>
int main()
{
FILE *fp = stdin

int n

fprintf(fp, "%d", 45)

}
Correct Answer

(C) Nothing

[#183] What will be the output of the following C code? #include <stdio.h>
#include <string.h>
int main()
{
char *str = "hello, world"

char *str1 = "hello, world"

if (strcmp(str, str1))
printf("equal")

else
printf("unequal")

}
Correct Answer

(B) unequal

[#184] What will be the output of the following C code? #include <stdio.h>
int main()
{
int n

scanf("%d", n)

printf("%d
", n)

return 0

}
Correct Answer

(B) Undefined behavior

[#185] Which of the following is not a valid mathematical function?
Correct Answer

(D) fmod(x)