what will the following program do?
void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p);
//Line no:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
}
//Line no 15//
a) Swap contents of p & a and print:(New string, string)
b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1
Answer / abhiraj
a = malloc....
this sentence will give the error Lvalue required..
Is This Answer Correct ? | 11 Yes | 0 No |
what is the use of #pragma pack, wer it is used?
main() { int i=5; printf("%d",++i + i); } output is 10 ------------------------ main() { int i=5; printf("%d",i++ + i); }output is 12 why it is so? give appropiate reason....
How to declare a variable?
What is union and structure in c?
Is c pass by value or reference?
What is a C array and illustrate the how is it different from a list.
What is the difference between typedef and #define?
What does 1f stand for?
What is scanf_s in c?
write a program for the normal snake games find in most of the mobiles.
What are the different types of constants?
write a program to find the given number is prime or not
2 Answers Accenture, Vasutech,