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...

i want to asked a question about c program the question is:

create a c program that displays all prime numbers less than
500? using looping statement

Answer Posted / vishnu nayak

int main()
{
unsigned int i,k;
unsigned int temp;
int count =0;
printf("enter the number \n");
scanf("%u",&i);
printf("\n");

for(temp =2;temp<i;temp++)
{
count =0;
for(k =2;k<=i;k++)
{
if((temp % k) == 0)
count++;

}
if(count <=1 )
printf("%u \n",temp);

}
getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of a ‘’ character?

1092


in linking some of os executables are linking name some of them

2141


What are types of preprocessor in c?

1076


Write a program to show the change in position of a cursor using c

1070


Explain the difference between malloc() and calloc() in c?

1051


Explain why can’t constant values be used to define an array’s initial size?

1355


can we change the default calling convention in c if yes than how.........?

2535


Explain the Difference between the New and Malloc keyword.

1139


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1263


Is there a built-in function in C that can be used for sorting data?

1267


What is scope of variable in c?

1046


How can I list all of the predefined identifiers?

986


What are examples of structures?

1114


differentiate built-in functions and user – defined functions.

1088


how to write optimum code to divide a 50 digit number with a 25 digit number??

3270