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 |
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.
what is the use of macro program
the format specified for hexa decimal is a.%d b.%o c.%x d.%u
write a program to display the frequency of each element in a given array in c language
to find the closest pair
what is the output of the following program? 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); }
Explain the advantages and disadvantages of macros.
String concatenation
Explain that why C is procedural?
Can we use visual studio for c?
what is a function prototype?
Explain #pragma statements.