Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


#include<stdio.h>
#include<conio.h>
void main()
{
float a;
clrscr();
a=0.5;
if(a==0.5)
printf("yes");
else
printf("no");
getch();
}

Answers were Sorted based on User's Feedback



#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / abhishek singh

yes in output when a=0.5;
but when a=0.4 or 0.6
it no in output

Is This Answer Correct ?    19 Yes 5 No

#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / ak

yes

Is This Answer Correct ?    6 Yes 0 No

#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / ravi kant singh

Answer is it will print no.....because you can not compare two floating point number upto precision 

Is This Answer Correct ?    3 Yes 2 No

#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / ankita sharma

Answer will be yes. we can compare two floating point numbers. as a is having value 0.5 and when it is compared with 0.5 so 1st printf would get executed which is inside if statement. so we would get answer as "yes" on the console window as output.

Is This Answer Correct ?    1 Yes 0 No

#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / maniac

yes

Is This Answer Correct ?    1 Yes 1 No

#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / rajan12233

yes

Is This Answer Correct ?    0 Yes 0 No

#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / sandeep

output is no beacause the default datatype of a floatingpoint value is "double",and doubles are always bigger than floats
so in above a is "float" where 0.5 is double

Is This Answer Correct ?    0 Yes 0 No

#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / sandeep

HI froends this is sandeep,
Coming to the question :
First of all we should know that in c language:
integers by default are treated as int,
and numbers with decimal point as double.
so int the ques tion "a is float",but "0.5 is double by default" and "double > float by default"
so "a==0.5" turns out to be false,
so else statement will be executed


output:no

Is This Answer Correct ?    0 Yes 0 No

#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a=..

Answer / syam kumar

output is no

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Interview Questions

Explain what are the advantages and disadvantages of a heap?

0 Answers  


What are c identifiers?

0 Answers  


Are enumerations really portable?

0 Answers  


Define recursion in c.

0 Answers  


biggest of two no's with out using if condition statement

8 Answers  


Is boolean a datatype in c?

0 Answers  


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

0 Answers  


What is the size of empty structure in c?

0 Answers  


Result of the following program is main() { int i=0; for(i=0;i<20;i++) { switch(i) case 0:i+=5; case 1:i+=2; case 5:i+=5; default i+=4; break;} printf("%d,",i); } } a)0,5,9,13,17 b)5,9,13,17 c)12,17,22 d)16,21 e)syntax error

8 Answers   IBM,


what is pointer?

13 Answers   HCL, TCS,


what are bitwise shift operators?

4 Answers  


is c language is a object oreinted language?

5 Answers   TCS,


Categories