0

I have no idea why.
The lines it's skipping is the system("PAUSE");.
Not the first two but the last two.

#include <stdlib.h>
#include <stdio.h>

int main()
{
      char Big, Small;
      Big='Z';
      Small='z';
      printf("Z=%d.\nz=%d.\n",Big,Small);
      system("PAUSE");
      int X,Y;
      X=72;
      Y=104;
      printf("74=%c.\n104=%c.\n",X,Y);
      system("PAUSE");
      double DblNum = 123.456;
      printf("f=%f.\nScientific=%e.\ntestF=%F.\n",DblNum,DblNum,DblNum);
      system("PAUSE");
      char Newline = '\n';
      printf("newline=%d.\n",Newline);
      system("PAUSE");
      return 0;
}
3
Contributors
6
Replies
7
Views
10 Years
Discussion Span
Last Post by ~s.o.s~
0

I just tried it in VC++ express now too and it worked.
I used Dev-C++ before.
I guess i'm not going to be using Dev-C++ again.

Thanks.

0

I got the same problem in another program I made using VC++ express now.

#include <stdlib.h>
#include <stdio.h>

int main()
{
	putchar(66);
	putc(121,stdout);
	putchar(101);
	putchar(10);
	system("PAUSE");

	int in = 123;
	int floa = 123.456;
	printf("%-3d\n%-6.3f\n",in,floa);
	system("PAUSE");
}

It ignores the last system("PAUSE"); but not the first one.
I need to know what causes these problems.
Dev-C++ wasn't the only compiler with this problem.

0

Its always a good practice not to ignore warnings which appear when you compile your code. A warning about 'converting from float to int' would have given you the reason why your program is not working.

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.