manjulatha


{ City } hyderabad
< Country > india
* Profession *
User No # 60114
Total Questions Posted # 0
Total Answers Posted # 4

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 25
Users Marked my Answers as Wrong # 12
Questions / { manjulatha }
Questions Answers Category Views Company eMail




Answers / { manjulatha }

Question { HCL, 8880 }

main()

{

char *a = "Hello ";

char *b = "World";

clrscr();

printf("%s", strcat(a,b));

}

a. Hello

b. Hello World

c. HelloWorld

d. None of the above


Answer

Ans. C
No space between hello and world

Is This Answer Correct ?    4 Yes 2 No

Question { 14867 }

main()

{

static char
names[5][20]={"pascal","ada","cobol","fortran","perl"};

int i;

char *t;

t=names[3];

names[3]=names[4];

names[4]=t;

for (i=0;i<=4;i++)

printf("%s",names[i]);

}


Answer

Its an error since names contains strings they cannot be
assigned like this.

Is This Answer Correct ?    6 Yes 3 No


Question { HCL, 8617 }

why we use pointer in c


Answer

use of pointers makes the code more efficient and compact.
1.to acess array elements
2. to return more than one value to a function.
3. to acess dynamically allocated memory.
4. to implement data structures like linked lists,trees.

Is This Answer Correct ?    0 Yes 1 No

Question { 10343 }

main()
{
printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3));
}


Answer

'3' is a character so it take 1 byte
"3" is a string containing 2 characters 3 and \0 so it takes
2bytes
3 is a integer and it takes 4 bytes
so answer is 1 2 4

Is This Answer Correct ?    15 Yes 6 No