Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


#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?

Answers were Sorted based on User's Feedback



#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) m..

Answer / fazlur rahaman naik

The output will b : RamcoSystems

Is This Answer Correct ?    17 Yes 0 No

#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) m..

Answer / 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

#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) m..

Answer / mage

The program is not correct. What is present in memory
beyond "Ramco" is not known and we are trying to
attach "Systems". May be we are overwriting something which
is unsafe.

To concatenate two strings declare the first as array.

example: char p1[50];
char *p2;
p2 = malloc(25);
strcpy(p1, "Ramco");
strcpy(p2,"Systems");
strcat(p1,p2);

Is This Answer Correct ?    7 Yes 1 No

#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) m..

Answer / v.srinivasan

#include<stdio.h>

main()
{
char *p1,*p2;
p1 = (char *)malloc(25);
p2 = (char *)malloc(25);
strcpy(p1,"Ramco");
strcpy(p2,"Systems");
strcat(p1,p2);
printf("%s",p1);
}



the output will be RamcoSystems

we don't need the following libraries under Linux 2.6
#include<string.h> and
#include<alloc.h>
to run this program.

Is This Answer Correct ?    5 Yes 0 No

#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) m..

Answer / khaja

ramco system

Is This Answer Correct ?    3 Yes 1 No

#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) m..

Answer / mastan vali.shaik

25Ramco25Systems

Is This Answer Correct ?    2 Yes 13 No

Post New Answer

More C Interview Questions

What is nested structure?

0 Answers  


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

0 Answers  


what is the difference between procedure oriented and object oriented progaming language

1 Answers  


Explain what is wrong with this program statement? Void = 10;

0 Answers  


can we execute the program with the object file

1 Answers  


Explain the difference between ++u and u++?

0 Answers  


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

0 Answers   Aspire, Infogain,


two progs are given. one starts counting frm 0 to MAX and the other stars frm MAX to 0. which one executes fast.

5 Answers   Verifone,


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

0 Answers   Infosys,


int main() { int i=1; switch(i) { case '1': printf("hello"); break; case 1: printf("Hi"); break; case 49: printf("Good Morning"); break; } return 0; }

3 Answers  


Can you pass an entire structure to functions?

0 Answers  


how to capitalise first letter of each word in a given string?

0 Answers  


Categories