P
PRADEEP
sir,
I request you to give the explanation for the below mentioned
problems:
1)
#include<conio.h>
#include<stdio.h>
void main()
{
int i=9;
printf("%d %d %d %d",i++,++i,i--,--i);
getch();
}
output
9 9 8 8
I want to know how came this o/p ,when one would obviously expect the
o/p
to be 9 11 11 9.please give me an explanation for this.
2)
#include<conio.h>
#include<stdio.h>
void main()
{
int in;
printf("Enter a number:");
scanf("%d\n",in);
printf("ANSWER\n");
printf("%d\n",in);
}
output
Enter a number:6
-----------------------------------------------------
ANSWER
6
NOTE:the dotted lines after the prompt "enter a number" forces the
programmer to enter sth (a character or a string (with or without
space)or a number)
but doesn't proceed to next statement unless sth is entered as
mentioned above.
Also,note that dotted lines do not appear as shown in the above sample
o/p.This is for
putting forward my doubt in trenchant vein.I need an explanation for
the above problem
too.
Thanking you.
your's respectfully.
I request you to give the explanation for the below mentioned
problems:
1)
#include<conio.h>
#include<stdio.h>
void main()
{
int i=9;
printf("%d %d %d %d",i++,++i,i--,--i);
getch();
}
output
9 9 8 8
I want to know how came this o/p ,when one would obviously expect the
o/p
to be 9 11 11 9.please give me an explanation for this.
2)
#include<conio.h>
#include<stdio.h>
void main()
{
int in;
printf("Enter a number:");
scanf("%d\n",in);
printf("ANSWER\n");
printf("%d\n",in);
}
output
Enter a number:6
-----------------------------------------------------
ANSWER
6
NOTE:the dotted lines after the prompt "enter a number" forces the
programmer to enter sth (a character or a string (with or without
space)or a number)
but doesn't proceed to next statement unless sth is entered as
mentioned above.
Also,note that dotted lines do not appear as shown in the above sample
o/p.This is for
putting forward my doubt in trenchant vein.I need an explanation for
the above problem
too.
Thanking you.
your's respectfully.