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

the output will be

#include<stdio.h>
int main ()
{
int i;
i = 9/2;
printf("%i",i);
return 0;
}

Answer Posted / jac

The output will be 4. The division is being stored in a variable of type int - division operations upon it will comport to the rules of integer division, which says, "Divide but drop the remainder". Moreover, the formatting flag "%i" prints an integer value all the time, even if you try and pass it a floating-point type (which will probably give you garbage - without a cast, that is).

http://www.cs.cf.ac.uk/Dave/C/node4.html - search "integer division"
http://linux.die.net/man/3/printf - look for the "i" formatting string

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is equivalent to ++i+++j?

1053


What is getch () for?

1166


What is f'n in math?

1020


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1952


Why doesn't C support function overloading?

2646


Why is sprintf unsafe?

1010


What are the benefits of c language?

1125


Tell me what is null pointer in c?

1038


What is 'bus error'?

1108


how could explain about job profile

1875


What is the difference between int main and void main in c?

1112


What are the disadvantages of external storage class?

1019


What is FIFO?

1564


What is the difference between constant pointer and constant variable?

1182


What are the advantages of c preprocessor?

1224