New course! Every coder should learn Generative AI!
Try a free lesson+ 1
What is the output of the following program?and also tell why it is like that...
#include <stdio.h> int main() { int x ; printf("%d",scanf("%d",&x)); return 1; }
1 Answer
+ 2
scanf() returns the number of arguments that were successfully assigned, so the output depends on whether the input is good or bad.
https://en.cppreference.com/w/c/io/fscanf