ADITI Company Programming Program

Q. In the following program

#include
main()
{
char *pDestn,*pSource="I Love You Daddy";
pDestn=malloc(strlen(pSource));
strcpy(pDestn,pSource);
printf("%s",pDestn);
free(pDestn);
}
Option
(a)Free() fails
(b)Strcpy() fails
(c)prints I love You Daddy
(d)error

Read Solution (Total 1)

ADITI Other Question

Q. Give the output for the following program segment.

#ifdef TRUE
int I=0;
#endif

main()
{
int j=0;
printf("%d %dn",i,j);
}
Q. What is the output for the following program

#include
main()
{
char a[5][5],flag;
a[0][0]='A';
flag=((a==*a)&&(*a==a[0]));
printf("%dn",flag);
}