Accept a Number from user and check whether it is Prime or Not
#include
#include
void main()
{
int n,i;
printf("Enter the Number = ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%2!=0)
{
printf("%d\n",i);
}
}
}
----------------------------------------------------------------------------------------------------------------------------------------
OUTPUT : -
Related Posts:
Write a program to print all even number from 1 to N terms
#include#includevoid main(){ int n,i; printf("Enter the Number … Read More
Write a program to print table of a given number
#include#includevoid main(){ int n,i,table; printf("Enter Number which you want table =… Read More
Write a program to find the factorial of given Number
#include#includevoid main(){ int n,i,temp=1; printf("Enter the … Read More
Write a program to print the sum of even position & product of odd position digit of any inputted Number
#include#includevoid main(){ int n,i,temp=0,a=1; printf("Enter … Read More
Accept a Number from user and find reverse of it
#include#includevoid main(){ int i,n; printf("Enter the Number … Read More
Accept a Number from user and check whether it is Prime or Not
#include#includevoid main(){ int n,i; printf("Enter the Number … Read More