Loop with Do..While in C++
Looping is one of the basic Logarithms which can be fond in all software development program like C++, Pascal, Java or Visual Basic.Net. Actually many kinds of Looping in C++. But in this case, we are going to make a sample of Looping with Do..While in C++.
Well, here we are, type the code bellow in C++ Program of course :
#include<'stdio.h>
#include<'conio.h>
main()
{
int n; //Ammount of sum series number
int angka;
int jumlah;
printf("Entry amount of series = "); scanf("%i",&n);
jumlah=0;
angka=1;
do
{
jumlah= jumlah+angka;
angka= angka+1;
} while(angka<=n);
printf("Amount of Series is = %i",jumlah);
getch();
return 0;
}
Note : Like in the previous article in C++, Don't use ' before stdio.h. In This case, I write just have to appear in Javascript of the Blog. Just try it, remember, If we want to master program well, we have to practice much :). Created by Ader
Well, here we are, type the code bellow in C++ Program of course :
#include<'stdio.h>
#include<'conio.h>
main()
{
int n; //Ammount of sum series number
int angka;
int jumlah;
printf("Entry amount of series = "); scanf("%i",&n);
jumlah=0;
angka=1;
do
{
jumlah= jumlah+angka;
angka= angka+1;
} while(angka<=n);
printf("Amount of Series is = %i",jumlah);
getch();
return 0;
}
Note : Like in the previous article in C++, Don't use ' before stdio.h. In This case, I write just have to appear in Javascript of the Blog. Just try it, remember, If we want to master program well, we have to practice much :). Created by Ader