Skip navigation.

Putra Pratama's page

Assalamualaikum

Borland C++ Oct,22nd 08

, , ,

#include<stdio.h>

main()
{
int i,sum=0;
printf("masukkan sebuah bilangan=");
scanf("%d",&i);
while(i>=1)
{
sum+=i; //sum = sum+i;
i--; //i=i-1;
}

printf("hasil jumlah = %d",sum);
getchar();
getchar();

return 0;
}

#include<stdio.h>

main()
{
int i,j,sum=0,counter1=1,counter2=2;
printf("masukkan bilangan pertama=");
scanf("%d",&i);
printf("masukkan bilangan kedua=");
scanf("%d",&j);

while(counter1<=i)
{
counter2=1;
while(counter2<=j)
{
sum +=counter1+counter2;
counter2++;
}
counter1++;
}

printf("maka nilainya adalah= %d",sum);
getchar ();
getchar ();
return 0;
}

English Assignment 1Maple

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

December 2009
M T W T F S S
November 2009January 2010
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31