write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / sathya
#include<iostream.h>
void main()
{
int n,a;
cout<<"enter the limit";
cin>>n;
for(i=1;i<=n;i++}
{
if(i=1)
{
cout<<"1 is neither a prime nor a composite no";
}
else if(i%1==0|i%i==0)
{
cout<<i<<"is a prime number";
}
}
}
| Is This Answer Correct ? | 63 Yes | 165 No |
Post New Answer View All Answers
Can you think of a logic behind the game minesweeper.
What are the preprocessor categories?
Which header file is used for clrscr?
Why c is called procedure oriented language?
hi, which software companys will take,if d candidate's % is jst 55%?
Explain how can a program be made to print the name of a source file where an error occurs?
Explain what is the most efficient way to store flag values?
What are the 5 organizational structures?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
what is a function method?give example?
What is a floating point in c?
Where are some collections of useful code fragments and examples?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
What is the difference between ++a and a++?
What is array in C