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

how to return a multiple value from a function?

5 Answers   Wipro,


What is your nationality?

1 Answers   GoDB Tech,


void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }

3 Answers   Accenture,


main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  


to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD

6 Answers   Synergy,






Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

1 Answers  


main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }

1 Answers  


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

2 Answers   Wipro,


What are segment and offset addresses?

2 Answers   Infosys,


how to concatenate the two strings

1 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 Answers  


Categories