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 |
How to count a sum, when the numbers are read from stdin and stored into a structure?
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?
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); }
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
#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); }
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
main() { printf("%x",-1<<4); }
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); }
#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); }
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()); }
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++; } }