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 i;
i=2;
i++;
if(i=4)
{
printf(i=4);
}
else
{
printf(i=3);
}
output of the program ?

Answer Posted / manishsoni

it show errors,bcoz
in c language,to print anyone we want to enclose that in " ".
so both the printf statement are wrong,so it is not show
proper result.
To show proper result we show that program and describe line
to line....

#include<stdio.h>
#include<conio.h>
int main()
{
int i;
i=2;
i++;
if(i=4)
{
printf("4");
}
else
{
printf("3");
}
getch();
}

In this prg i is declare as int type,after that 2 is store
into the i after i increased by not store so there is no
affect of the i's value.
at if statement
if(i=4)
here 4 is assigned into the i variable so
if statement is look like as;
if(4)which is treat is as ;
the if statement is thought that any non zero value is true
so if statement is true..
and execute first printf statement so the value is
printf("i=4");
so the final answer or result is:
i=4;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why c is a mother language?

1041


What is the difference between int main and void main?

1051


Write a c program to demonstrate character and string constants?

2192


Explain what is the most efficient way to store flag values?

1232


What is d'n in c?

1124


Which is best linux os?

1028


Is that possible to store 32768 in an int data type variable?

1082


How can I ensure that integer arithmetic doesnt overflow?

1173


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1700


please send me the code for multiplying sparse matrix using c

2178


What are the types of data types and explain?

1091


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1170


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

1110


console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

1179


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

2188