0
#include<stdio.h>
#include<conio.h>

int main()
{
    int no;
    
    scanf("%d", &no);
    
    
    
    printf("%d %d", no,no++);
    
    getch();return 0;
}

the output of this program is '4 3'.. my questino is WHY? this program should first print the number which is entered.. and then when it prints the next number it should add 1 to the number and then print it.. shouldnt it?

its not doig that..WHY?

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by c_newbie1
0

Your not guaranteed how the arguments in printf are evaluated, left to right, right to left..It depends on the C compiler your using!!!!!!!!!!!!!!!!!!!!!(many ! so the reply is urgent).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.