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 will be the outcome of the following conditional statement if the value of variable s is 10?

755


Can we use any name in place of argv and argc as command line arguments?

606


What is multidimensional arrays

624


Explain how can I write functions that take a variable number of arguments?

606


Why do we use pointer to pointer in c?

593






How can you check to see whether a symbol is defined?

584


Write a program to generate random numbers in c?

658


Using which language Test cases are added in .ptu file of RTRT unit testing???

3580


How many bytes is a struct in c?

719


What is the 'named constructor idiom'?

636


what is event driven software and what is procedural driven software?

2005


What does. int *x[](); means ?

629


How do you list files in a directory?

559


Explain how can type-insensitive macros be created?

566


Why c is faster than c++?

625