what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answers were Sorted based on User's Feedback
Answer / bharath s
The answer is Garbage value...
The answer willbe lik -113...Depending upon the compailer
If we declare as..
static char ch;
Then Answer is 0.....
| Is This Answer Correct ? | 21 Yes | 0 No |
Answer / paul
It'll give a warnin tat "a is never used...If u Continue
executing...it will the memory addres that is currently
used.
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / sadasiva
It gives compilation warning but not Error.
While running ,gives Run time check error and prints some
garbage value.
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / anu
I think it will not give any error and it will print some
garbage value.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / manju
The answer is garbage value because ch is not initialised
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sirajuddin
variable ch is of character type and nothing is assigned
to it where as 'a' is of interger type.
In the printf statement we are placing variable 'ch' along
with %d which will display a garbage value.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sulagna samapika
what will be the output of printf("%d")
ans-
the outpot is 0
| Is This Answer Correct ? | 2 Yes | 0 No |
let's take a code struct FAQ { int a; char b; float c; double d; int a[10]; }*temp; now explain me how the memory will be allocated for the structure FAQ and what address will be in the structure pointer (temp)....................
Explain the difference between the local variable and global variable in c?
which is faster execution: loops or recursion?
what about "char *(*(*a[])())();"
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
What is that continue statement??
What is a pointer in c?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
2 Answers HCL, IBM, Satyam, Vimal, Vimukti Technologies,
What are structural members?
when to use : in c program?
Compare and contrast compilers from interpreters.
#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?