write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)

Answer Posted / shravani

void main()
{
int i,num=1;
clrscr();

while(num<=100)
{ i=2; while(i<=num)
{ if(num%i==0)
break;
i++; }
if(i==num)
printf("\n%d is Prime",num);
num++;
}
getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between Macro and ordinary definition.

745


Explain bitwise shift operators?

649


Why use int main instead of void main?

613


Is c is a low level language?

578


What is the use of a static variable in c?

608






Why do we use header files in c?

598


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

2822


What is the size of structure pointer in c?

631


What is the difference between local variable and global variable in c?

709


What is zero based addressing?

729


application attempts to perform an operation?

1508


What is the best style for code layout in c?

643


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

1743


What are the loops in c?

607


What are the different file extensions involved when programming in C?

784