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 the following series
2 5 11 17 23 31 41 47 59 ...

Answer Posted / dixit

#include<stdio.h>
int main()
{

int i=0,j=0,c=0,ct=-1,n=0;
scanf("%d",&n);
printf("2 ");
for(i=4;i<100;i++)
{ c=1;
for(j=2;j<=i/2;j++)
{
if(i%j==0) c=0;
}
if(c!=0){ ct++;
if(ct%2==0 && n>1 ) {
printf("%d ",i);
n--;
}
}}
return 0;
}

Is This Answer Correct ?    8 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to swap two numbers without using a temporary variable?

1112


What is modifier & how many types of modifiers available in c?

1014


How can you determine the size of an allocated portion of memory?

1288


Are c and c++ the same?

1038


Is main a keyword in c?

1119


Why double pointer is used in c?

1022


Explain how can I convert a string to a number?

1076


which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

2043


Why c is known as a mother language?

1075


What do you understand by normalization of pointers?

1049


What was noalias and what ever happened to it?

1027


Is there any possibility to create customized header file with c programming language?

1052


What is difference between stdio h and conio h?

1358


What are data structures in c and how to use them?

1153


What are linked lists in c?

1118