Q10 - k=0 if(j>15998 k=1 if(i%a[j]==0 break j if(j==t...

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>15998) // k=1; if(i%a[j]==0) break; j++; if(j==t) { a[t]=i; s=s+i; cout<<t<<" "<<a[t]<<" "<<s<<endl; t++; } } } getch(); } //...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM1 taught by Professor Thakur during the Spring '06 term at University of Mumbai.

Ask a homework question - tutors are online