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;
}

Recommended Answers

All 6 Replies

worked ok for me on Vista using VC++ 2005 Express. If you are using *nix maybe it does not have a pause shell command ???

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.

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.

Its not the compiler -- your program contains a bug line 13 -- change the data type to float and it will probably work as expected.

Oh yea, sorry :$

Thanks

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.