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


how can write all 1to 100 prime numbers using for loop,if and
break ?

Answers were Sorted based on User's Feedback



how can write all 1to 100 prime numbers using for loop,if and break ?..

Answer / sandeep

#include<stdio.h>
main()
{
int a=2;

work:
printf("%d",a);
a=a+2;
check:
if(a<=100)
goto work;

}

Is This Answer Correct ?    1 Yes 0 No

how can write all 1to 100 prime numbers using for loop,if and break ?..

Answer / divyanshu

#include<iostream.h>
#incude<conio.h>
int main()
{
int x=100,i,p=1;
cout<<"enter the no.";
cin>>x;
for(i=2;i<x;i++)
{
if(x%i==0)
{
p=2;
break;
}
if(x==1)
{
cout<<"prime no.";
}
getch();
}

Is This Answer Correct ?    2 Yes 12 No

Post New Answer

More C Interview Questions

How will you find a duplicate number in a array without negating the nos ?

0 Answers  


What type is sizeof?

0 Answers  


what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it

5 Answers   DIT,


who is the father of c

4 Answers   Infosys,


How to implement call back functions ?

3 Answers   HP,


How many types of operators are there in c?

0 Answers  


What are the languages are portable and platform independent?Why they are like that?

1 Answers   Excel, Satyam,


1)which of following operator can't be overloaded. a)== b)++ c)?! d)<=

16 Answers   CybOrg, Siemens,


What are the two types of functions in c?

0 Answers  


Write down the program to sort the array.

4 Answers   Impiger,


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

0 Answers  


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

0 Answers   InterGraph,


Categories