write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / ali
#include<iostream.h>
#include<conio.h>
int main ()
{
for (int i=2; i<100; i++)
for (int j=2; j<i; j++)
{
if (i % j == 0)
break;
else if (i == j+1)
cout << i << "\t";
}
getch();
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What are local static variables?
What is difference between main and void main?
What is an lvalue in c?
What is a function simple definition?
How can I manipulate individual bits?
What are the 5 types of inheritance in c ++?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
Is null valid for pointers to functions?
What is wrong in this statement? scanf(ā%dā,whatnumber);
what are the advantages of a macro over a function?
What is #include conio h?
Here is a neat trick for checking whether two strings are equal
Can we use any name in place of argv and argc as command line arguments?
Why clrscr is used in c?
Is fortran faster than c?