GeeksforGeeks » C/C++ Programming Questions
Output of C program?
(2 posts)-
#include<stdio.h> int main(void) { printf("%.*s", 0, "geeksforgeeks"); getchar(); return 0; } -
It doesn't print anything. See http://en.wikipedia.org/wiki/Printf#printf_format_placeholders
If we put something other than 0 as second parameter to printf(), then we will get something printed on the screen. Like following program would print "geeks" (first 5 characters)
#include<stdio.h> int main(void) { printf("%.*s", 5, "geeksforgeeks"); getchar(); return 0; }
Reply
You must log in to post.