How will you print % character?

a. printf(“\%”)

b. printf(“\\%”)

c. printf(“%%”)

d. printf(“\%%”)

Answers were Sorted based on User's Feedback



How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”..

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

How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”..

Answer / govind verma

using printf("%%");
bcoz compiler place %% to % ....... this grammr written in compiler,,,,,,

Is This Answer Correct ?    3 Yes 1 No

How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”..

Answer / anupriya

printf("%");

Is This Answer Correct ?    0 Yes 1 No

How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”..

Answer / guest

c) printf(" %% ");

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More C Code Interview Questions

main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,


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); }

1 Answers  


main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }

4 Answers   CSC,


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)

1 Answers  


write a program for area of circumference of shapes

0 Answers  






main() { extern out; printf("%d", out); } int out=100;

1 Answers  


main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }

2 Answers   Wipro,


write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?

1 Answers  


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

2 Answers   GATE,


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)); }

1 Answers   Satyam,


why array index always strats wuth zero?

2 Answers  


main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }

1 Answers  


Categories