Home disini
widget by sy@ms

Latest Posts

Program Prosedure Pada C++

Langsung za ya....


#include <stdio.h>

void tambah (int a, int b, int *tbh);
void kurang (int a, int b, int *krg);
void kali (int a, int b, int *kl);
void bagi (int a, int b, float *bg);

int a,b;
int tbh, krg, kl;
float bg;

void main()
{
printf("a = ");scanf("%d",&a);
printf("b = ");scanf("%d",&b);

tambah(a,b,&tbh);
kurang(a,b,&krg);
kali(a,b,&kl);
bagi(a,b,&bg);

printf("tambah = %d",tbh);
printf("kurang = %d",krg);
printf("kali = %d",kl);
printf("bagi = %f",bg);

}

void tambah(int a, int b int *tbh)
{
*tbh = a+b;
}
void kurang(int a, int b int *krg)
{
*krg = a-b;
}
void kali(int a, int b int *kl)
{
*kl = a*b;
}
void bagi(int a, int b float *bg)
{
*bg = a/b;
}





#include <stdio.h>

void tukar (int a, int *b);

int a,b,c;


void main()

{
printf("a = ");scanf("%d",&a);
printf("b = ");scanf("%d",&b);

tukar(&a,&b);

printf("a = %d",a);
printf("b = %d",b);
}

void tukar (int *a, int *b)
{

c=*a;
*a=*b;
*b=c;
}





#include <stdio.h>

void lling(float r, float*ll);
void lsg3(float a, float t, float*ls);
void lpsg(float s, float *lp);
void lppj(float p, float l, float *lpj);

void main()
{
lling(r,&ll);
lsg3(a, t, &ls);
lpsg(s, &lp);
lppj(p, l, &lpj);

printf("luas lingkaran = %f",ll);
printf("luas segitiga = %f",ls);
printf("luas persegi = %f",lp);
printf("luas persegi panjang = %f",lpj);
}

void lling(float r, float*ll)
{
float r, float ll;
printf("r = ");scanf("%d",&r);

*ll = 3.14*r*r*r;
}

void lsg3(float a, float t, float*ls)
{
float a, float t, float ls;
printf("a = ");scanf("%d",&a);
printf("t = ");scanf("%d",&t);

*ls = (a*t)/2;
}

void lpsg(float s, float*lp)
{
float s, float lp;
printf("s = ");scanf("%d",&s);

*lp = s*s*s;
}

void lppj(float p,float l, float*lpj)
{
float l,p;
float lpj;
printf("p = ");scanf("%d",&p);
printf("l = ");scanf("%d",&l);

*lpj = p*l;
}





#include <stdio.h>

void tbh(int a, int b, int *tambah);
int a,b,tambah;

void main()
{

printf("a = ");scanf("%d",&a);
printf("b = ");scanf("%d",&b);

tbh(a,b,&tambah);

printf("tambah = %d",tambah);


}

void tbh(int a, int b, int *tambah)
{
*tambah = a+b;
}





#include <stdio.h>

void luaslingkaran (float r, float *lling);
void luassegitiga (float a, float t, float *lsg3);
void luaspersegi (float s, float *lpsg);
void luaspersegipanjang (float p, float l, float *lppj);

float r,a,t,s,p,l;
float lling,lsg3,lpsg,lppj;

void main()
{

luaslingkaran(r,&lling);
luassegitiga(a,t,&lsg3);
luaspersegi(s,&lpsg);
luaspersegipanjang(p,l,&lppj);

}

void luaslingkaran (float r, float *lling)
{


printf("r = ");scanf("%f",&r);

*lling = 3.14 * r * r;
printf("luas lingkaran = %f\n",*lling);

}

void luassegitiga (float a, float t, float *lsg3)
{


printf("a = ");scanf("%f",&a);
printf("t = ");scanf("%f",&t);

*lsg3 = (a*t)/2;
printf("luas segitiga = %f\n",*lsg3);
}

void luaspersegi (float s, float *lpsg)
{


printf("s = ");scanf("%f",&s);

*lpsg = s * s;
printf("luas persegi = %f\n",*lpsg);

}

void luaspersegipanjang (float p, float l, float *lppj)

{
printf("p = ");scanf("%f",&p);
printf("l = ");scanf("%f",&l);

*lppj = p * l;
printf("luas persegi panjang = %f\n",*lppj);


}



Woke, Semoga bermanfaat,
Salam senyum dariku........




Salam senyum dariku untuk semuanya, tetaplah untuk bersemangat. Jangan lupa Comment atau isi buku tamu ya sob. Sedikit pemberitahuan untuk sobat yang ingin mengambil [Copy-Paste], Owner tidak melarang sobat untuk memperbanyak artikel namun Owner berharap sobat berlaku dengan bijak agar mencantumkan link active maupun yang tidak. Owner berharap partisipasinya ya sob.



0 komentar:

Jam Sekarang
Tanggal
Salam Sapa :
Status Blogging :

*ket. status : Terjadwal : Berarti yang punya blog tidak bisa berinternet [ More... ]





sy@ms
skyNET program


Join the conversation for skyNET program

 
 free web counter Counter Powered by  RedCounter

© 2011 || Copyright by sy@ms || Thanks for skyNET program All Reserved

Technology Blogs TopOfBlogs Top Blogs Internet Internet Blogs Phil Backlink Display Pagerank
Yahoo bot last visit powered by MyPagerank.Net
USA Backlinks Free Backlinks Service at USABacklinks.com! Auto Backlink Gratis Indonesia : Top Link Indo My Ping in TotalPing.com ping fast  my blog, website, or RSS feed for Free