Basic Programming Quiz 0010
Examine the code snippets given below—-
#include <stdio.h>
int main()
{
char ch;
while((ch = getchar()) != '\0')
putchar(ch);
return 0;
}
What does the program display?
Look at another code snippets—-
#include <stdio.h>
int main()
{
while( putchar(getchar( )) != '\0' ) ;
return 0;
}
Now, what does it display?
Is there any difference in program execution between these two code snippets?
Advertisement

