main()
{
char *str1="abcd";
char str2[]="abcd";
printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd"));
}
Answer / susie
Answer :
2 5 5
Explanation:
In first sizeof, str1 is a character pointer so it gives you
the size of the pointer variable. In second sizeof the name
str2 indicates the name of the array whose size is 5
(including the '\0' termination character). The third sizeof
is similar to the second one.
Is This Answer Correct ? | 14 Yes | 3 No |
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }
Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
What is your nationality?
main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
void main() { int const * p=5; printf("%d",++(*p)); }
3 Answers Infosys, Made Easy, State Bank Of India SBI,