write the program for prime numbers?
Answer Posted / sudesh kumar
#include<iostream.h>
#include<conio.h>
void main()
{
int no;
cout<<"enter a no";
cin>>no;
for(i=2;i<no;i++)
{
r=no%i;
if(r==0)
{
p==0;
break;
}}
if(p==1)
{
cout<<"prime no";
}
else
{
cout<<"note prime";
}
getch();
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How are structure passing and returning implemented?
What are the 5 types of organizational structures?
What is the difference between test design and test case design?
What type is sizeof?
Explain what is the benefit of using const for declaring constants?
What are data types in c language?
Explain the difference between the local variable and global variable in c?
What is sizeof return in c?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
What is difference between structure and union in c?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What is a const pointer?
What is the use of void pointer and null pointer in c language?
Why we use stdio h in c?
what are non standard function in c