main()
{
char p[] = "hello world!";
p = "vector";
printf("%s",p);
}

Answers were Sorted based on User's Feedback



main() { char p[] = "hello world!"; p = "vector"; printf("%s",p); ..

Answer / amir khan

Vector because char a[] gives error due to empty parenthesis

Is This Answer Correct ?    4 Yes 3 No

main() { char p[] = "hello world!"; p = "vector"; printf("%s",p); ..

Answer / shiva

vector

Is This Answer Correct ?    13 Yes 17 No

Post New Answer

More C Interview Questions

Print all the palindrome numbers.If a number is not palindrome make it one by attaching the reverse to it. eg:123 output:123321 (or) 12321

7 Answers   HCL,


what will be the output of this program main() { int i=1; while (i<=10); { i++; } }

11 Answers  


int j =15,i; for (i=1; 1<5; ++i) {printf ("%d%d ",j,i); j = j-3; }

2 Answers  


You have an int array with n elements and a structure with three int members. ie struct No { unsigned int no1; unsigned int no2; unsigned int no3; }; Point1.Lets say 1 byte in the array element is represented like this - 1st 3 bits from LSB is one number, next 2 bits are 2nd no and last 3 bits are 3rd no. Now write a function, struct No* ExtractNos(unsigned int *, int count) which extracts each byte from array and converts LSByte in the order mentioned in point1.and save it the structure no1, no2, no3. in the function struct No* ExtractNos(unsigned int *, int count), first parameter points to the base address of array and second parameter says the no of elements in the array. For example: if your array LSB is Hex F7 then result no1 = 7, no2 = 2, no3 = 7. In the same way convert all the elements from the array and save the result in array of structure.

2 Answers   Qualcomm,


what is the output of the program?? #include<stdio.h> main ( ) { int a=010,sum=0,tracker: for(tracker=0;tracker<=a;tracker++) sum+=tracker; printf(ā€œ %d\nā€,sum); } what is the difference between a=10 and a=010??

3 Answers   Oracle,






How can I convert a number to a string?

0 Answers  


What's the best way to declare and define global variables?

7 Answers  


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

0 Answers  


any "C" function by default returns an a) int value b) float value c) char value d) a & b

0 Answers  


What is abstract data structure in c?

0 Answers  


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

0 Answers   TISL,


main() { unsigned int k = 987 , i = 0; char trans[10]; do { trans[i++] =(char) (k%16 > 9 ? k%16 - 10 + 'a' : '\0' ); } while(k /= 16); printf("%s\n", trans); }

4 Answers   Vector,


Categories