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

What will be printed as the result of the operation below:

#include<..>

int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%d\n",x);
x++;
changevalue(x);
printf("Second output:%d\n",x);
modifyvalue();
printf("Third output:%d\n",x);
}

Answer Posted / selloorhari

The Output will be:

First output : 12
Second output : 13
Third output : 14

for changevalue() function:
Even though the value of x(11) is sent to
changevalue() and it returns x(12), no variable is assigned
to capture that 12. So, in main() function, x remains as 11(
not as 12 ) . then it gets incremented and prints the value
12...

And, the Same story for other functions also.....

Is This Answer Correct ?    2 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In C programming, how do you insert quote characters (‘ and “) into the output screen?

1580


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

3371


In a header file whether functions are declared or defined?

1173


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

2012


Explain the use of bit fieild.

1198


What are the Advantages of using macro

1221


What are the different types of control structures?

1082


What is a good way to implement complex numbers in c?

1091


What are header files in c?

1122


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2387


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1375


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1321


how to count no of words,characters,lines in a paragraph.

4472


What does stand for?

1141


What is a shell structure examples?

1148