C
Programming and Technical
Programming
Output
What is the output and why?
#include
int main(){
int i=(char)65;
printf("%d %c %f %d",i,i,i,i);
return 0;
}
Read Solution (Total 10)
-
- 65(integer) A(char) 0.000000(float) 4200624(garbage)
- 8 years agoHelpfull: Yes(3) No(0)
- 65,A,0.000000,garbage value
- 8 years agoHelpfull: Yes(2) No(0)
- Char65=a,
%f=65/1
%d=65
%c=a - 8 years agoHelpfull: Yes(1) No(0)
- int i=(char)65 becomes
int i=a;
since a is not declared or it is not assigned with any values
It wil give a errorneous output - 8 years agoHelpfull: Yes(1) No(0)
- 65 A 65.0 65
- 8 years agoHelpfull: Yes(1) No(0)
- here it is error because _AX is undeclared. if it is declared then output will be zero
- 8 years agoHelpfull: Yes(0) No(0)
- 65,a,65/1,65
- 8 years agoHelpfull: Yes(0) No(1)
- 65/1 means?
am getting 0..why?
- 8 years agoHelpfull: Yes(0) No(0)
- It will not give any output as because in print statement float is used .If we remove %f from print statement then output will be 65,A,65.
and else if we want to get output in given program then for that we have to declare float first. - 8 years agoHelpfull: Yes(0) No(0)
- answer will be 65 A 0.000000 65
- 7 years agoHelpfull: Yes(0) No(0)
C Other Question