Contoh Listing Program C++ Jumlah Bilangan Ganjil



#include<vcl.h>
#include<stdio.h>
#include<conio.h>

main()
{
int i,n,jml;
n=-1;
jml=0;
printf("\n");
for (i=1;i<=15;i++)
{
n=n+2;
jml=jml+n;
}
printf("Hasil Jumlah dari 1+3+5+7+9+11+13+15+17+19+21+23+25+27+29=%d",jml);
getch();
}

psecode
INPUT : N = -1 ; JLM=0
hasil N = N+2
hasil JML = JML+N
If(N=15)
OUTPUT : (print JML)
else
OUTPUT : (go to 2)

Previous
Next Post »
Thanks for your comment

Random Posts