Write a program to print the following series
2 5 11 17 23 31 41 47 59 ...
Answers were Sorted based on User's Feedback
Answer / 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 |
i want explaination about the program and its stack reprasetaion fibbo(int n) { if(n==1 or n==0) return n; else return fibbo(n-1)+fibbo(n-2); } main() { fibbo(6); }
any string of bits of length 'n' represents a unique non- negative integer between.............?
what is the similarities between. system call and library function?
Write a programme to find even numbers without using any conditional statement?
3 Answers ADD Software, Infosys,
What is a floating point in c?
If you know then define #pragma?
which operator having highest precedence? a.)+ b.)++ c.)= d.)%
Is c programming hard?
fn f(x) { if(x<=0) return; else f(x-1)+x; }
What is the process to generate random numbers in c programming language?
how to write a c program to print list of fruits in alpabetical order?
Write a program to print fibonacci series using recursion?