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 |
#include<stdio.h> #include<conio.h> int main() { int a[4][4]={{5,7,5,9}, {4,6,3,1}, {2,9,0,6}}; int *p; int (*q)[4]; p=(int*)a; q=a; printf("\n%u%u",p,q); p++; q++; printf("\n%u%u",p,q); getch(); return 0; } what is the meaning of this program?
what are the compilation steps? ( i want inside the compiler )
What is sizeof c?
What is difference between stdio h and conio h?
what is the diffrenet bettwen HTTP and internet protocol
What are the advantages of using new operator as compared to the function malloc ()?
What is a memory leak? How to avoid it?
how do you redirect stdout value from a program to a file?
What is difference between array and structure in c?
int x=sizeof(!5.856); What will value of variable x?
what is diffrence between string and character array?
Can true be a variable name in c?