write the program for prime numbers?
Answer Posted / karthika
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2;
clrscr();
printf("\n entert a number");
scanf("%d",&num);
while(c<=num-1)
{
if(num%i==0)
{
printf("given number is not a prime number\n");
break;
}
i++;
}
if(i==num);
printf(given number is a prime number\n");
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What does a function declared as pascal do differently?
What are the advantages of c language?
Disadvantages of C language.
Why we use int main and void main?
What is the code in while loop that returns the output of given code?
Can we replace the struct function in tree syntax with a union?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
List out few of the applications that make use of Multilinked Structures?
Which programming language is best for getting job 2020?
Explain how can you check to see whether a symbol is defined?
Why void main is used in c?
What is the purpose of ftell?
What does p mean in physics?
Describe explain how arrays can be passed to a user defined function
What is the value of uninitialized variable in c?