main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}
Answer / susie
Answer :
I hate U
Explanation:
For floating point numbers (float, double, long
double) the values cannot be predicted exactly. Depending on
the number of bytes, the precession with of the value
represented varies. Float takes 4 bytes and long double
takes 10 bytes. So float stores 0.9 with less precision than
long double.
Rule of Thumb:
Never compare or at-least be cautious when using
floating point numbers with relational operators (== , >, <,
<=, >=,!= ) .
| Is This Answer Correct ? | 12 Yes | 0 No |
what is the output of the below program & why ? #include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); }
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
9 Answers CSC, GoDB Tech, IBM,
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
0 Answers Mbarara University of Science and Technology,
What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }
find simple interest & compund interest
Write a c program to search an element in an array using recursion
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
why java is platform independent?
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }
#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,