SlideShare a Scribd company logo
#include<iostream.h>
#include<conio.h>
void main()
{
int n,i,j,isprime,sum=0;
clrscr();
cout<<"Find sum of all between 1 to";
cin>>n;
for(i=2;i<=n;i++)
{
isprime=1;
for(j=2;j<=i/2;j++)
{
if(i%j==0)
{
isprime=0;
break;
}
}
if(isprime==1)
{ z
sum+=i;
}
}
cout<<"Result is:"<<sum;
getch();
}

More Related Content

What's hot

Slides
SlidesSlides
Slidesvti
 
Luis cuñas programacion
Luis cuñas programacionLuis cuñas programacion
Luis cuñas programacionluisitofranklin
 
Scanfill polygon
Scanfill polygonScanfill polygon
Scanfill polygon
Sonia Pahuja
 
Practica 4 errores
Practica 4 erroresPractica 4 errores
Practica 4 erroresUVM
 
Corridas de los programas
Corridas de los programasCorridas de los programas
Corridas de los programasXavi Devaluado
 
Rafaeltorres
RafaeltorresRafaeltorres
Rafaeltorres
rfltorres1
 
Funcion num a letras
Funcion num a letrasFuncion num a letras
Funcion num a letras
Rene Isidro
 
Convertir numero a letras.
Convertir numero a letras.Convertir numero a letras.
Convertir numero a letras.
campeon87
 
07 5 반복문(break,contine).key
07 5 반복문(break,contine).key07 5 반복문(break,contine).key
07 5 반복문(break,contine).key
Changwon National University
 
Michell abecedario
Michell abecedarioMichell abecedario
Michell abecedarioMichelle G P
 
Bubble sort
Bubble sortBubble sort
Bubble sort
Hitesh Kumar
 
2012 December Supervisor of the Month Nominee
2012 December Supervisor of the Month Nominee2012 December Supervisor of the Month Nominee
2012 December Supervisor of the Month NomineeMohamed Yasir
 

What's hot (16)

Slides
SlidesSlides
Slides
 
Programacion
ProgramacionProgramacion
Programacion
 
Luis cuñas programacion
Luis cuñas programacionLuis cuñas programacion
Luis cuñas programacion
 
Scanfill polygon
Scanfill polygonScanfill polygon
Scanfill polygon
 
Practica 4 errores
Practica 4 erroresPractica 4 errores
Practica 4 errores
 
Corridas de los programas
Corridas de los programasCorridas de los programas
Corridas de los programas
 
Rafaeltorres
RafaeltorresRafaeltorres
Rafaeltorres
 
Funcion num a letras
Funcion num a letrasFuncion num a letras
Funcion num a letras
 
Correcion
CorrecionCorrecion
Correcion
 
Convertir numero a letras.
Convertir numero a letras.Convertir numero a letras.
Convertir numero a letras.
 
07 5 반복문(break,contine).key
07 5 반복문(break,contine).key07 5 반복문(break,contine).key
07 5 반복문(break,contine).key
 
Michell abecedario
Michell abecedarioMichell abecedario
Michell abecedario
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
bai tap-loi-giai-ngon-ngu-lap-trinh-c
 bai tap-loi-giai-ngon-ngu-lap-trinh-c bai tap-loi-giai-ngon-ngu-lap-trinh-c
bai tap-loi-giai-ngon-ngu-lap-trinh-c
 
2012 December Supervisor of the Month Nominee
2012 December Supervisor of the Month Nominee2012 December Supervisor of the Month Nominee
2012 December Supervisor of the Month Nominee
 
Programas for
Programas forProgramas for
Programas for
 

More from Ankit Dubey

Unit 1 android and it's tools quiz {mad cwipedia}
Unit 1 android and it's tools quiz {mad cwipedia}Unit 1 android and it's tools quiz {mad cwipedia}
Unit 1 android and it's tools quiz {mad cwipedia}
Ankit Dubey
 
Scheduling
Scheduling Scheduling
Scheduling
Ankit Dubey
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
Ankit Dubey
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
Ankit Dubey
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
Ankit Dubey
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
Ankit Dubey
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
Ankit Dubey
 
Ch5 cpu-scheduling
Ch5 cpu-schedulingCh5 cpu-scheduling
Ch5 cpu-scheduling
Ankit Dubey
 
Ch4 threads
Ch4 threadsCh4 threads
Ch4 threads
Ankit Dubey
 
Ch3 processes
Ch3 processesCh3 processes
Ch3 processes
Ankit Dubey
 
Ch2 system structure
Ch2 system structureCh2 system structure
Ch2 system structure
Ankit Dubey
 
Ch1 introduction-to-os
Ch1 introduction-to-osCh1 introduction-to-os
Ch1 introduction-to-os
Ankit Dubey
 
Android i
Android iAndroid i
Android i
Ankit Dubey
 
Mongodb mock test_ii
Mongodb mock test_iiMongodb mock test_ii
Mongodb mock test_ii
Ankit Dubey
 
Android mock test_iii
Android mock test_iiiAndroid mock test_iii
Android mock test_iii
Ankit Dubey
 
Android mock test_ii
Android mock test_iiAndroid mock test_ii
Android mock test_ii
Ankit Dubey
 
Ajp notes-chapter-06
Ajp notes-chapter-06Ajp notes-chapter-06
Ajp notes-chapter-06
Ankit Dubey
 
Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05
Ankit Dubey
 
Ajp notes-chapter-04
Ajp notes-chapter-04Ajp notes-chapter-04
Ajp notes-chapter-04
Ankit Dubey
 
Ajp notes-chapter-03
Ajp notes-chapter-03Ajp notes-chapter-03
Ajp notes-chapter-03
Ankit Dubey
 

More from Ankit Dubey (20)

Unit 1 android and it's tools quiz {mad cwipedia}
Unit 1 android and it's tools quiz {mad cwipedia}Unit 1 android and it's tools quiz {mad cwipedia}
Unit 1 android and it's tools quiz {mad cwipedia}
 
Scheduling
Scheduling Scheduling
Scheduling
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Ch5 cpu-scheduling
Ch5 cpu-schedulingCh5 cpu-scheduling
Ch5 cpu-scheduling
 
Ch4 threads
Ch4 threadsCh4 threads
Ch4 threads
 
Ch3 processes
Ch3 processesCh3 processes
Ch3 processes
 
Ch2 system structure
Ch2 system structureCh2 system structure
Ch2 system structure
 
Ch1 introduction-to-os
Ch1 introduction-to-osCh1 introduction-to-os
Ch1 introduction-to-os
 
Android i
Android iAndroid i
Android i
 
Mongodb mock test_ii
Mongodb mock test_iiMongodb mock test_ii
Mongodb mock test_ii
 
Android mock test_iii
Android mock test_iiiAndroid mock test_iii
Android mock test_iii
 
Android mock test_ii
Android mock test_iiAndroid mock test_ii
Android mock test_ii
 
Ajp notes-chapter-06
Ajp notes-chapter-06Ajp notes-chapter-06
Ajp notes-chapter-06
 
Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05
 
Ajp notes-chapter-04
Ajp notes-chapter-04Ajp notes-chapter-04
Ajp notes-chapter-04
 
Ajp notes-chapter-03
Ajp notes-chapter-03Ajp notes-chapter-03
Ajp notes-chapter-03
 

Ooprc3b