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 count a sum, when the numbers are read from stdin and stored into a structure?

1 Answers  


hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?

6 Answers  


main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a[4]='d'; abc(a); } abc(char a[]){ a++; printf("%c",*a); a++; printf("%c",*a); }

2 Answers  


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

0 Answers  


Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

1 Answers  






#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }

1 Answers  


#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }

1 Answers  


main() { printf("%x",-1<<4); }

3 Answers   HCL, Sokrati, Zoho,


main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }

1 Answers  


#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }

1 Answers  


char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }

2 Answers  


main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }

1 Answers  


Categories