Q7 - if(i%a[j]==0 break j if(j==t a[t]=i if(t>9999{cout<<a[t<<endl getch t getch/

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(); long int a[15000],i,t,j; a[0]=2; t=1; for(i=3;i<2000000;i++) { j=0; if(t<10001) { 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: { if(i%a[j]==0) break; j++; if(j==t) { a[t]=i; if(t>9999) {cout<<a[t]<<endl; getch();} 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