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

I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1998


Tell me what is the purpose of 'register' keyword in c language?

1041


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

1159


What is the importance of c in your views?

1241


How can I manipulate strings of multibyte characters?

1159


What is bin sh c?

1099


What is I ++ in c programming?

1170


Implement bit Array in C.

1200


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

1053


How can I write a function analogous to scanf?

1236


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

1121


How do you define CONSTANT in C?

1370


What are pragmas and what are they good for?

1059


Describe static function with its usage?

1278


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

1258