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...


int a=0,b=2;
if (a=0)
b=0;
else
b=*10;
What is the value of b ?

Answers were Sorted based on User's Feedback



int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?..

Answer / kc

The code will not compile as statement "b=*10" is invalid"
It should be "b*=10".

If i assume "b*=10" then the output will be 20

Reason:
a=0;
b=2;
if(a=0 means 0) so b=0 will not execute
b=b*10=2=10=20;

Is This Answer Correct ?    37 Yes 6 No

int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?..

Answer / sonukrrock

20

Is This Answer Correct ?    28 Yes 11 No

int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?..

Answer / akash

The value of b will be 20.

Because when a=0 is presented in if condition, it will take it as false condition. So the else block will execute.

Is This Answer Correct ?    3 Yes 0 No

int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?..

Answer / guest

0

Is This Answer Correct ?    8 Yes 7 No

int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?..

Answer / kishore sharma

a=0;
b=2;
but  
condition
if(a=0)(b=0)
so
b=*10;
answer is
b=b*10   (b=0)
b=0*10;
  0

Is This Answer Correct ?    0 Yes 1 No

int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?..

Answer / sandeep kumar

if (a=0)
is a wrong statement.
Since it should be
if (a==0)

so, it will throw an error

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............

3 Answers  


What are the types of data files?

0 Answers  


Explain the Difference between the New and Malloc keyword.

0 Answers   InterGraph,


What is malloc return c?

0 Answers  


What are the usage of pointer in c?

0 Answers  


Is fortran faster than c?

0 Answers  


A woman had somany gloves and hats 22 red,34 blue, 45 white...there was power cut and she took a glove and how many gloves shud she take so that she gets a pair of glove fr each color??

3 Answers   TCS,


Can u please send me the exam pattern and also Previous papers to javed123go@gmail.com

0 Answers  


Write a program which returns the first non repetitive character in the string?

0 Answers   Expedia,


Write a program for the following series? 1 121 12321 1234321 123454321 12345654321 1234567654321 123456787654321 12345678987654321 1234567890987654321 123456789010987654321 12345678901210987654321 1234567890123210987654321 .........1234321............ ..........123454321............ ..........12345654321............ 7 8 9 0 1 Pls............?

5 Answers  


what are enumerations in C

0 Answers   TCS,


What is the meaning of typedef struct in c?

0 Answers  


Categories