What will be the output of the following C code? [code]#include<stdio.h> #pragma GCC poison printf main() { printf("123hoidap");

What will be the output of the following C code?
Code:
#include<stdio.h>
#pragma GCC poison printf
main()
{
    printf("123hoidap");
    return 0;
}
A. error is thrown
B. 123hoidap is printed
C. warning but no error
D. yrdnoufnas is printed
 
Answer: a
Explanation: The code shown above results in an error: attempt to use poisoned printf
When the above program is compiled, it results in an error since #pragma was used to specify that the identifier printf should not be used in the program.
 

Tìm kiếm

Back
Top