#include<stdio.h>
main()
{
char *p1;
char *p2;
p1=(char *) malloc(25);
p2=(char *) malloc(25);
strcpy(p1,"Ramco");
strcpy(p2,"Systems");
strcat(p1,p2);
printf("%s",p1);
}
Tell me the output?
Answer Posted / sumant
the output will be RamcoSystems
but we need 2 more libraries
#include<string.h> and
#include<alloc.h>
to run this program. in else case it will not work.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Create a simple code fragment that will swap the values of two variables num1 and num2.
What is bss in c?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
Explain how can a program be made to print the name of a source file where an error occurs?
Can you return null in c?
Explain what is #line used for?
What do you mean by dynamic memory allocation in c?
How do I swap bytes?
What is pass by reference in functions?
What is function pointer c?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
How can variables be characterized?
Why do we use static in c?
What is c method?