char ch="{'H','I',0};printf("%s",ch);what is output

Answers were Sorted based on User's Feedback



char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / prasath

thats error

Is This Answer Correct ?    2 Yes 0 No

char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / punith

error

Is This Answer Correct ?    2 Yes 0 No

char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / reddy

segmentation fault

Is This Answer Correct ?    2 Yes 1 No

char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / vaibhav

it gives an error becoz of " .
if we ignore him then o/p will be HI .

Is This Answer Correct ?    1 Yes 0 No

char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / vijay

h

Is This Answer Correct ?    0 Yes 0 No

char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / sathish kumar

Hi All,

this is sathish. upto my knwowledge it depends on
compiler. in TurboC if u give char ch={'AB'}; it will
print B. In VC++ if u give char ch={'ABC'} it will give
C. But in TurboC u cannot give like this char ch={'ABC'};
(three character r nt allowed).

Is This Answer Correct ?    0 Yes 0 No

char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / vignesh1988i

first of all the character initilization itself will give an error. since 0 is not provided with single codes. if we neglect that error or we correct the above error. the final output will be 0

Is This Answer Correct ?    0 Yes 0 No

char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / kalpana.y


There will be no output
because,in char function the total values should be given
in invited comas i.e,

ch={"H,I,O"};

Is This Answer Correct ?    0 Yes 1 No

char ch="{'H','I',0};printf("%s",ch);what is output..

Answer / vignesh1988i

it will print hi...

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

in malloc and calloc which one is fast and why?

1 Answers  


increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {

2 Answers   HCL, Syntel, TCS,


write a program to find the given number is prime or not

2 Answers   Accenture, Vasutech,


how to estimate the disk access time? e.g. the time between read one byte and another byte in the disk.

3 Answers   Google,


What is the modulus operator?

0 Answers  






What is merge sort in c?

0 Answers  


Write a program that will read the input of any number of digits n in a row of shafh showing the breakdown of the printing and printing figures by the recursive function.

0 Answers  


what is the differance between pass by reference and pass by value.

7 Answers   Infosys,


What is volatile c?

0 Answers  


What is the difference between ‘g’ and “g” in C?

1 Answers  


in which language c language is written?

2 Answers  


What is a macro, and explain how do you use it?

0 Answers  


Categories