How will you print % character?
a. printf(“\%”)
b. printf(“\\%”)
c. printf(“%%”)
d. printf(“\%%”)
Answers were Sorted based on User's Feedback
Answer / ajay kumar
. printf("\%")
this is most genertally prefered for printing a %
u can also print % by printf("%");
but according to K&R(a standrad textbvuk by developer of C)
"\%" is prefered
If u have any queries mail me @ kumar.guttikonda@gmail.com
Is This Answer Correct ? | 7 Yes | 1 No |
Answer / govind verma
using printf("%%");
bcoz compiler place %% to % ....... this grammr written in compiler,,,,,,
Is This Answer Correct ? | 3 Yes | 1 No |
main() { int i = 3; for (;i++=0;) printf(“%d”,i); }
main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
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)
write a program for area of circumference of shapes
main() { extern out; printf("%d", out); } int out=100;
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come
func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }
why array index always strats wuth zero?
main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }