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
code for replace tabs with equivalent number of blanks
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
There seem to be a few missing operators ..
What is the process to create increment and decrement stamen in c?
Is c language still used?
swap 2 numbers without using third variable?
What is the most efficient way to store flag values?
What is pragma c?
What are 3 types of structures?
What is s or c?
What is the advantage of an array over individual variables?
Can a pointer be volatile in c?
What do you mean by dynamic memory allocation in c?
Can an array be an Ivalue?
What are valid signatures for the Main function?