write the program for prime numbers?
Answer Posted / sudesh kumar
#include<iostream.h>
#include<conio.h>
void main()
{
int no,i,r,p=1;
cout<<"enter a no";
cin>>no;
for(i=2;i<no;i++)
{
if(r==no%i)
{
p=0;
break;
}
}
if(p==0)
{
cout<<"the prime no";
}
else
{
cout<<"the no is note prime";
}
getch();
}
| Is This Answer Correct ? | 13 Yes | 14 No |
Post New Answer View All Answers
What does c value mean?
hi send me sample aptitude papers of cts?
What is a good data structure to use for storing lines of text?
What is a header file?
Explain Basic concepts of C language?
Why is sizeof () an operator and not a function?
What are near, far and huge pointers?
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
What is the code for 3 questions and answer check in VisualBasic.Net?
What is the use of bit field?
Explain what is the use of a semicolon (;) at the end of every program statement?
Who is the main contributor in designing the c language after dennis ritchie?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
Can you subtract pointers from each other? Why would you?
When should a far pointer be used?