write the program for prime numbers?
Answer Posted / anesh kumar
# include <iostream.h>
# include <conio.h>
int main()
{
int i,j=2,num=0;
cout<<"\n Enter the number";
cin>>i%j>>i;
while(j<=i/2)
{
if(i%j==0)
{
Cout<<"%d Is not prime number"<<i;
ch=1;
break;
}
else
{
j++;
}
}
if(num==0)
{
Cout<<"%d Is prime number"<<i;
}
getch();
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Define circular linked list.
i got 75% in all semester am i eligible for your company
int i=10; printf("%d %d %d", i, i=20, i);
What is quick sort in c?
What is c system32 taskhostw exe?
What are the various types of control structures in programming?
Explain what is the benefit of using an enum rather than a #define constant?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Why is c called c?
What are header files in c?
In C, What is the #line used for?
What is a program flowchart?
What is abstract data structure in c?
What are the advantages and disadvantages of c language?
What is the purpose of sprintf?