write the program for prime numbers?
Answer Posted / manish kumar
main()
{
int i,j=2,ch=0;
clrscr();
printf("\nENTER ANY NUMBER");
scanf("%d",&i);
while(j<=i/2)
{
if(i%j==0)
{
printf("%d IS NOT PRIME",i);
ch=1;
break;
}
else
{
j++;
}
}
if(ch==0)
{
printf("%d IS PRIME",i);
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Differentiate between declaring a variable and defining a variable?
How main function is called in c?
Why use int main instead of void main?
Write a program to print fibonacci series without using recursion?
What's the best way of making my program efficient?
Explain what is the difference between functions getch() and getche()?
What is substring in c?
What is the difference between char array and char pointer?
Explain is it valid to address one element beyond the end of an array?
What is void pointers in c?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What does the format %10.2 mean when included in a printf statement?
What is the function of this pointer?
What is getch () for?