• edited by
1,642 views
0 0 votes

Consider a C Program situation like this,
 

main()
    {
    float a=2.23564;
    printf("%d",a);
    }


Then what will be the output??
please help me..

1 Answer

0 0 votes
As here a is declared as float and a=2.23564

%d specifier is used to print some integer value but here a is declared as float so some garbage value will be printed as output.
Position:
Show:

Related questions

0 0 votes
2 answers 2 answers
1.4k
1.4k views
Nitesh Choudhary asked Jun 5, 2017
1,356 views
which compiler use for gate c output problems?
0 0 votes
1 1 answer
1.0k
1.0k views
Nitesh Choudhary asked Apr 16, 2017
1,022 views
There are many questions related to size of pointer and it's also depend on machine so anyone tell me source of reading pointer. (for Gate)
0 0 votes
2 2 answers
2.4k
2.4k views
radha gogia asked Aug 21, 2015
2,412 views
I went through this article but couldn't get one point where it says that "It only makes a difference if the integer is negative (for signed inputs) or between INT_MAX+1 ...
1 1 vote
1 answers 1 answer
1.5k
1.5k views
abhinowKatore asked Jan 18, 2023
1,450 views
What will be the output of the following program ?answer is 8 but I am getting 5, please explain where I am wrong