write the program for prime numbers?
Answer Posted / love
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num, i;
printf("enrer the value");
scanf("%d",&num);
i=2;
while(i<=num-1)
{
if(num%i==0)
{
printf("not a prime");
break;
}
i++;
}
if(i==num)
printf("prime");
getch();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a pointer on a pointer in c programming language?
Is c call by value?
What does main () mean in c?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
What are dangling pointers? How are dangling pointers different from memory leaks?
What is a keyword?
Is swift based on c?
What is the difference between strcpy() and memcpy() function in c programming?
What are the benefits of c language?
What is difference between union All statement and Union?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What is use of null pointer in c?
What is the difference between exit() and _exit() function?
What is the use of clrscr?
What is register variable in c language?