Q10 - k=0; // if(j>15998) // k=1; if(i%a[j]==0)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> # void main() { clrscr(); unsigned long int a[16000],i,t,j,s=0; //int k=0; a[0]=2; t=1; for(i=3;i<2000000;i++) { j=0; while(j<t) { //
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: k=0; // if(j&gt;15998) // k=1; if(i%a[j]==0) break; j++; if(j==t) { a[t]=i; s=s+i; cout&lt;&lt;t&lt;&lt;&quot; &quot;&lt;&lt;a[t]&lt;&lt;&quot; &quot;&lt;&lt;s&lt;&lt;endl; t++; } } } getch(); } //...
View Full Document

Ask a homework question - tutors are online