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 / satwant singh

#include<stdio.h>
#include<conio.h>
void main()
{
long int a,b,i;
clrscr();
printf("enter start no");
scanf("%ld",&a) ;
printf("enter last no");
scanf("%ld",&b);
for(i=a;i<=b;i++)
{
if((i%2==0)||(i%3==0)||(i%5==0)||(i%7==0))
{
//printf("not prime==%ld",i);
}
else
printf("its prime==%ld\n",i);
}

getch();

}

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which one would you prefer - a macro or a function?

1134


What does %d do in c?

1011


Explain main function in c?

1137


What are the 4 types of organizational structures?

1162


What are the usage of pointer in c?

1243


What is variable initialization and why is it important?

1341


What is the difference between procedural and functional programming?

1136


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

1175


How to declare pointer variables?

1315


What do you mean by a sequential access file?

1136


What is difference between static and global variable in c?

1103


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1961


How does normalization of huge pointer works?

1230


What is string concatenation in c?

1138


how many key words availabel in c a) 28 b) 31 c) 32

1129