Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / abhay

#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("1\t");
for(int i=1;i<=100;i++)
{
flag=0;
for(x=2;x<=i;x++)
{
if(i%x==0)
{
flag=1;
break;
}
else
continue;
}
if(i==x)
printf("%d\t",i);
}
getch();
}

Is This Answer Correct ?    291 Yes 108 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between array and pointer in c?

1082


Describe dynamic data structure in c programming language?

1091


What is an identifier?

1031


Is there a way to switch on strings?

1083


what type of questions arrive in interview over c programming?

2025


Difference between linking and loading?

1095


What is calloc malloc realloc in c?

1052


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

1227


I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1938


Difference between strcpy() and memcpy() function?

1136


What is meant by 'bit masking'?

1386


Which control loop is recommended if you have to execute set of statements for fixed number of times?

1341


using for loop sum 2 number of any 4 digit number in c language

2330


what is different between auto and local static? why should we use local static?

1122


Do you know the use of fflush() function?

1059