write the program for prime numbers?
Answer Posted / pratibha
#include<stdio.h>
#include<conio.h>
void main()
{
int no,i,count=0;
clrscr();
printf("enter the no");
scanf("%d",&no);
for(i=1;i<=no;i++)
{
if(no%i==0)
{
count=count+1;
}
}
if(count<=2)
{
printf("this is prime no");
}
else
{
printf("this is not prime");
}
getch();
}
| Is This Answer Correct ? | 17 Yes | 14 No |
Post New Answer View All Answers
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
What does stand for?
All technical questions
Write a program to generate random numbers in c?
What is the difference between a string and an array?
What is dynamic variable in c?
Explain how do you declare an array that will hold more than 64kb of data?
Can we replace the struct function in tree syntax with a union?
Is int a keyword in c?
Explain what is the concatenation operator?
By using C language input a date into it and if it is right?
Is c easy to learn?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
what are the advantages of a macro over a function?
Why doesnt the call scanf work?