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 print all the prime numbers with in the
given range

Answer Posted / ankit giriya

#include<stdio.h>
void main()
{
int i, prime, lim_up, lim_low, n;
clrscr();
printf(“\n\n\t ENTER THE LOWER LIMIT…: “);
scanf(“%d”, &lim_low);
printf(“\n\n\t ENTER THE UPPER LIMIT…: “);
scanf(“%d”, &lim_up);
printf(“\n\n\t PRIME NUMBERS ARE…: “);
for(n=lim_low+1; n<lim_up; n++)
{
prime = 1;
for(i=2; i<n; i++)
if(n%i == 0)
{
prime = 0;
break;
}
if(prime)
printf(“\n\n\t\t\t%d”, n);
}
getch();
}

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define C in your own Language.

1033


how to construct a simulator keeping the logical boolean gates in c

2198


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1646


What is array within structure?

1061


What does calloc stand for?

1087


How can I write a function that takes a format string and a variable number of arguments?

1003


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1729


Is linux written in c?

989


What are the preprocessor categories?

1002


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2131


How can you find out how much memory is available?

1015


If the size of int data type is two bytes, what is the range of signed int data type?

975


What is a macro in c preprocessor?

1051


What is assignment operator?

1000


What are the back slash character constants or escape sequence charactersavailable in c?

1124