Print an integer using only putchar. Try doing it without
using extra storage.
Answers were Sorted based on User's Feedback
Answer / cmos
This can be done by recursion.
Since the number of recursive calls is not significant, it does not affect the performance much
printnumber(int i)
{
if(i == 0)
return;
printnumber(i/10);
putchar(’0′ + i%10);
}
| Is This Answer Correct ? | 2 Yes | 4 No |
C program to print magic square of order n where n > 3 and n is odd
What is full form of PEPSI
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }
write a origram swaoing valu without 3rd variable
main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }
String copy logic in one line.
main() { int c=- -2; printf("c=%d",c); }
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit
Print an integer using only putchar. Try doing it without using extra storage.
char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }