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
Answer / civa
The Output will be:
First output : 12
Second output : 13
Third output : 13
| Is This Answer Correct ? | 24 Yes | 3 No |
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 |
Can include files be nested?
what are # pragma staments?
How to compare array with pointer in c?
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
What is the difference between array and pointer in c?
What is c token?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
difference between memcpy and strcpy
A program to write a number of letters and numbers, such as counting and display
What is the proper way of these job Tell me about there full work
IS STRUCTURES CAN BE USED WITHIN AN ARRAY?
Explain the difference between call by value and call by reference in c language?