C Programming - Input / Output - Discussion
Discussion Forum : Input / Output - Find Output of Program (Q.No. 10)
10.
What will be the output of the program ?
#include<stdio.h>
int main()
{
printf("%%%%\n");
return 0;
}
Discussion:
36 comments Page 3 of 4.
Josna said:
1 decade ago
printf("%%%\n");
This will also gives the output of %% . Why ?
This will also gives the output of %% . Why ?
Vidhya said:
1 decade ago
I agree with Niranjan.
Ramesh said:
1 decade ago
Agree with the Niranjan but a small change. If want print %.
Dirctly printing occurred.
Dirctly printing occurred.
Viswa said:
1 decade ago
Thank you neeranjan. Your explanation is correct for this output.
Rajkumar said:
1 decade ago
After the % the C expects a format specifier so it assumes one % as format specifer and prints %% as output
Ponrasu said:
1 decade ago
why for printing %% in c?? wat reason?? tis is only c are c++
Chandrakumar said:
1 decade ago
Ya. Thank you niranjan I'm cleared from your explanation and I also for salesh for given a logic behind this.
Madhu said:
1 decade ago
Is it right?
Prateek said:
1 decade ago
There is no logic behind above answers.
Why happend it?
Why happend it?
Praveen said:
1 decade ago
Salesh has given good logic.
Thank you Salesh.
Thank you Salesh.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers