what will be the output for the following program?

main()
{
char ch = 'k';
char c;
printf("%c",c);
}

Answers were Sorted based on User's Feedback



what will be the output for the following program? main() { char ch = 'k'; char..

Answer / hussain reddy

garbage value

Is This Answer Correct ?    2 Yes 0 No

what will be the output for the following program? main() { char ch = 'k'; char..

Answer / sudarsan

no out put
bcz
after declaration, inside the memory
1. a location of 1byte will be reserve for ch

and also for c but the value k be store in ch
and nothing in C.
|----|
|k |ch
|----|


|----|
| |c
|----|

Is This Answer Correct ?    3 Yes 1 No

what will be the output for the following program? main() { char ch = 'k'; char..

Answer / akansha

there vl b no result.......

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

0 Answers   Wipro,


44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?

6 Answers   Amdocs,


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

0 Answers  


Write a c program using for loop to print typical pattern if number of rows is entered by keyboard. ABCBA AB BA A A

1 Answers  


what is linkage error when it occurs in c program

3 Answers  






what is the advantage of software development

1 Answers  


Why are algorithms important in c program?

0 Answers  


Here is a good puzzle: how do you write a program which produces its own source code as output?

0 Answers  


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

0 Answers   Wilco,


What is external and internal variables What is dynamic memory allocation what is storage classes in C

3 Answers  


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

0 Answers  


What is the difference between far and near ?

0 Answers  


Categories