Uncategorized

Materi Algoritma dan Struktur Data 1


Materi bisa disedot disini

JAWABAN TUGAS (PROSEDUR)

#include <stdio.h>
int r,luas;

void hitung();

void main(){
 hitung();
}

void hitung(){
 printf("Inputkan Jari-jari (r) : ");
 scanf("%d",&r);
 luas=3.14*r*r;
 printf("Luasnya adalah: %d",luas);
}

JAWABAN TUGAS (FUNGSI)

#include <stdio.h>
int a,t,l;

int hitung();

void main(){
	printf("Inputkan alas: ");
	scanf("%d",&a);
	printf("Inputkan tinggi: ");
	scanf("%d",&t);
	l=hitung();
	printf("Luas = %d",l);
}

int hitung(){
	l=0.5*a*t;
	return l;
}

 

 

Maaf baru sempet upload… Keep on fire

Gbu

Salam Sayang

-y2-

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s