#include<stdio.h>
main()
{
int check, i, x,y,m;
printf("enter the number upto which check");
scanf("%d",&check);
y=1;
for(m=2; m<=check; m++)
{
for(x=2;x<m; x++)
{ y=m%x;
if(y==0)
break;
}
if(y!=0)
printf("%d is Prime number\n",m);
else printf("%d is not a prime number\n",m);
}
getch();
}
Chat with our AI personalities
well, to convert a fraction as a percent divide the top number by the bottom number,then multiply the result by 100and add the percentage sign (%)
write a c++program by using if statement to read a number and check whether it is positive or negative
VBnet program to find the prime numbers between 100 to 200?
Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.
Yes, do write, or if you're too lazy to your homework, use google.