write the program for prime numbers?
Answer Posted / sachin 12
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2,f=0,j;
printf("\n enter any number");
scanf("%d",&num);
a=num;
while(i<num)
{
if(num%i==0)
{
f=1
break;
}
i++;
}
if(f==i)
{
printf("\n the number is not prime");
}
else
{
printf(""\n the number is prime");
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Can one function call another?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
Explain what are binary trees?
How are Structure passing and returning implemented by the complier?
What is identifiers in c with examples?
What does it mean when the linker says that _end is undefined?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
What is sizeof array?
What is #line?
How do I create a directory? How do I remove a directory (and its contents)?
Explain how do you determine the length of a string value that was stored in a variable?
Can you please explain the difference between syntax vs logical error?
What the different types of arrays in c?
What is a static variable in c?
Explain the use of 'auto' keyword