Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prime Number or Not O(Sqrt(N)) - C++ #4

Open
sandeep-vaas opened this issue Oct 30, 2017 · 1 comment
Open

Prime Number or Not O(Sqrt(N)) - C++ #4

sandeep-vaas opened this issue Oct 30, 2017 · 1 comment

Comments

@sandeep-vaas
Copy link
Owner

No description provided.

@tiagokapp
Copy link

#include<stdio.h>

main()
{

int n, cont, primo, s,seq;
printf("digite quantos numeros primos vc deseja");
scanf("%d",&n);
s=0;
seq=0;
while (cont<=n)
{
	printf("digite a sequencia de numeros primos");
	scanf("%d",&seq);
	
	cont=cont+1;

	if (seq%1==seq && seq%seq==0)
	{
		seq=seq+1;
	
	s=s+seq;
	}

		    
    

}

	printf("o valor dos numeros primos eh %d\n\n\n",seq);
	printf("%d\n\n\n", s);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants