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 Posted / abhiraj
a = malloc....
this sentence will give the error Lvalue required..
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What is enumerated data type in c?
Write a program of advanced Fibonacci series.
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
Implement bit Array in C.
What is an array in c?
When should volatile modifier be used?
What does p mean in physics?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
What is else if ladder?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
Can you apply link and association interchangeably?
Explain how are portions of a program disabled in demo versions?
Why static variable is used in c?