write the program for prime numbers?
Answer Posted / akhilesh singh(m.c.a-iisem ois
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 ? | 1243 Yes | 384 No |
Post New Answer View All Answers
What is getche() function?
Explain how do you convert strings to numbers in c?
How can you determine the maximum value that a numeric variable can hold?
What is dangling pointer in c?
What is a example of a variable?
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
how to introdu5ce my self in serco
What is the description for syntax errors?
What is the use of printf() and scanf() functions?
C program to find all possible outcomes of a dice?
What are qualifiers in c?
how to count no of words,characters,lines in a paragraph.
How many loops are there in c?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
What are directives in c?