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);
}

Answers were Sorted based on User's Feedback



What will be printed as the result of the operation below: #include<..> int x; int modi..

Answer / civa


The Output will be:

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

Is This Answer Correct ?    24 Yes 3 No

What will be printed as the result of the operation below: #include<..> int x; int modi..

Answer / 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

More C Interview Questions

Can include files be nested?

0 Answers  


what are # pragma staments?

0 Answers  


How to compare array with pointer in c?

0 Answers  


Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58

0 Answers   Zoho,


What is the difference between array and pointer in c?

0 Answers  


What is c token?

0 Answers  


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

0 Answers  


difference between memcpy and strcpy

1 Answers  


A program to write a number of letters and numbers, such as counting and display

0 Answers  


What is the proper way of these job Tell me about there full work

0 Answers   EDS,


IS STRUCTURES CAN BE USED WITHIN AN ARRAY?

7 Answers   Caritor,


Explain the difference between call by value and call by reference in c language?

0 Answers  


Categories