write the program for prime numbers?
Answer Posted / pritam neogi
#include<stdio.h>
#include<conio.h>
void main()
{
int no,i;
clrscr();
printf(" Enter the Number U want to check:");
scanf("%d",&no);
i=2;
while(i<=no-1)
{
if(no%i==0)
{
printf(" %d is not Prime number",no );
// break;
}
i=i+1;
}
if(no==i)
printf("%d is a prime Number",no);
getch();
}
| Is This Answer Correct ? | 24 Yes | 17 No |
Post New Answer View All Answers
How would you rename a function in C?
How does sizeof know array size?
What is the size of enum in c?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
What is the description for syntax errors?
What is a char c?
Why doesnt long int work?
What is a class c rental property?
What is a macro in c preprocessor?
How can you increase the size of a statically allocated array?
Is c++ based on c?
Who invented bcpl language?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
What is the method to save data in stack data structure type?
How we can insert comments in a c program?