UAS2014 no.21&22

assalamualaikum wr wb

21.

#include<stdio.h>

#include<conio.h>

void main()
{
clrscr();
int q,w,e,r,t,y,a,b;
printf(“\n masukkan nilai=”);scanf(“%d”,&q);
printf(“\n masukkan nilai=”);scanf(“%d”,&w);
printf(“\n masukkan nilai=”);scanf(“%d”,&e);
printf(“\n masukkan nilai=”);scanf(“%d”,&r);
printf(“\n masukkan nilai=”);scanf(“%d”,&t);
clrscr();
printf(“\n________________________________”);
printf(“\n___lima bilangan secara acak____”);
printf(“\n________________________________”);
y=1;
while(y<=1)
{
y=y+1;
a=q+w+e+r+t;
b=a/2;
printf(“\n Total = %d”, a);
printf(“\n Rata2 = %d”, b);
}
printf(“\n________________________________”);
printf(“\n___created by : Moh Triyanto____”);
getch();
}

22.

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,q,w,e;
printf(“\nprogram matematika”);
printf(“\n__________________”);
printf(“\n__________________”);
printf(“\n bilangan”);printf(” tambah “);printf(” kali “);printf(” pangkat “);
printf(“\n__________________”);
i=1;
while(i<=5)
{
q=i+2;
w=i*2;
e=i*i;
printf(“\n %d”,i);printf(” %d”,q);printf(” %d”,w);printf(” %d”,e);
i=i+1;
}
printf(“\n___________________”);
printf(“\n created by : Moh Triyanto “);
getch();
}

wassalamualaikum wr wb

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s