Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Showing A Prime Number

$
0
0

Well, Hello. :)

I'm making an Code that shows Prime Number.

#include <stdio.h>
#include <windows.h>

int main(void)
{
	int num,t,l;
	num = 2;
	l = 1;
	printf("%d.", num);
mygoto:
	num = num + 1;
	t = num;
	while (t > 2 && l != 0){
		t = t - 1;
		l = num % t;
			}
	if (l != 0){
		printf("%d.", num);
		Sleep(2000);
		goto mygoto;
		}
	else{
		goto mygoto;
	}
}

However. It shows only 2.3.(None)

Need Help. Thank you.


Viewing all articles
Browse latest Browse all 15302

Trending Articles