write the program for prime numbers?
Answer Posted / oza priyanka
#include<stdio.h>
void main()
{
int num,i,cnt;
clrscr();
printf("\n\nEnter the number = ");
scanf("%d",&num);
for(i=2,cnt=0;i<num;i++)
{
if(num%i==0)
cnt=1;
}
if(cnt==0)
printf("\n\nprime number");
else
printf("\n\n not a prime number");
getch();
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Write a program to print fibonacci series without using recursion?
Describe the difference between = and == symbols in c programming?
How will you write a code for accessing the length of an array without assigning it to another variable?
What is structure in c definition?
How main function is called in c?
what is use of malloc and calloc?
Write a program to swap two numbers without using the third variable?
What are the different types of constants?
Write a program to reverse a linked list in c.
What is the size of structure in c?
In which layer of the network datastructure format change is done
What is a void pointer in c?
Explain what is a const pointer?
Explain void pointer?
What is a structure in c language. how to initialise a structure in c?