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

Answer Posted / jigar

#include<stdio.h>
#include<conio.h>
void main()
{
int a,n,f;
clrscr();
for(n=1;n<=100;n++)
{
f=0;

for(a=2;a<n;a++)
{
if(n%a==0)
{
f=1;
break;
}
}
if(f==0)
printf("%d",n);
}
getch();
}
// JIGAR SHOBHANA (ANIDA VACHHARA-GONDAL)

Is This Answer Correct ?    4 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointer in c?

745


What are types of structure?

608


How can I make sure that my program is the only one accessing a file?

683


what is bit rate & baud rate? plz give wave forms

1523


Why c is called procedure oriented language?

582






what are bit fields? What is the use of bit fields in a structure declaration?

1501


Explain how many levels deep can include files be nested?

630


What do you mean by keywords in c?

632


Implement bit Array in C.

678


What is wrong with this program statement?

610


What is identifier in c?

549


What does char * * argv mean in c?

626


how do you programme Carrier Sense Multiple Access

1521


What are the header files used in c language?

591


How can you determine the size of an allocated portion of memory?

748