Monday, March 22, 2010

printf %d

This is infosys question:
Write a program to print %d.

int main()
{
printf("%%d");
return 0;
}

Logic:
%% will print the % character in buffer.
d will print in buffer as usual.

0 comments:

Post a Comment