what is the output for this question:
main()
{
int i=1;
printf("%d%d%d",i,i++,++i);
}
Answer Posted / r.aruna
answer is 3,2,2
because print the value form right to left.
so,the first one ++i means preincrement.
so,incremented one,2
second one is i++ means postincrement .
it doesn't increment store in same location
but next i means 3.because move to next location
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Should I learn data structures in c or python?
Can you please explain the scope of static variables?
Explain what is the benefit of using enum to declare a constant?
Why use int main instead of void main?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
What is an auto variable in c?
Where are c variables stored in memory?
Why dont c comments nest?
What is modeling?
Write a program to generate the Fibinocci Series
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
I need testPalindrome and removeSpace
#include
Differentiate abs() function from fabs() function.
Lists the benefits of c programming language?
Describe explain how arrays can be passed to a user defined function