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
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
What is the use of a semicolon (;) at the end of every program statement?
What is the difference between the = symbol and == symbol?
Explain what standard functions are available to manipulate strings?
What is c preprocessor mean?
Write the control statements in C language
What is meant by 'bit masking'?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Do character constants represent numerical values?
What is a constant?
What does main () mean in c?
What is multidimensional arrays
What is a pointer value and address in c?
Why do we need volatile in c?
Explain high-order bytes.