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 |
Explain the bubble sort algorithm.
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
diff. between *p and **p
What is a loop?
How can I invoke another program or command and trap its output?
What is a node in c?
write a program that will read the temperature in Celsius and convert that into Fahrenheit.
how to construct a simulator keeping the logical boolean gates in c
write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" and the o/p should be "cba gfed jih onmlk srqp vut zyxw"
What are bit fields? What is their use?
if the total selling price of 15 items and the total profit earned on them is input through the keyboard, write a program to find the cost price of one of the item
What is the scope of static variables in c language?