Home disini
widget by sy@ms

Latest Posts

Program Function C++

Tancap langsung gan...


#include<stdio.h>

float tambah (float a,float b);
float a, float b, float tbh;

int main()
{
printf("a = ");scanf("%f",&a);
printf("b = ");scanf("%f",&b);
tambah(a,b);


printf("tambah = %f",tbh);

}

float tambah(float a, float b)
{



tbh = a+b;

return (tbh);
}





#include<stdio.h>

float hasilkali(float a ,float b);
float a,b;
float kali;

int main()
{
printf("a = ");scanf("%f",&a);
printf("b = ");scanf("%f",&b);

hasilkali(a,b);

printf("kali = %f",kali);


}

float hasilkali(float a, float b)
{


kali = a*b;



return (kali);
}





#include "stdafx.h"
#define phi 3.14

float luas(float r);
float r,t,vbola, vtabung, ls;

int main()
{

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

vbola = 1.33 *luas(r)*r;
printf(" volume bola =%.2f\n ",vbola);
vtabung = luas(r)*t;
printf(" volume tabung =%f ",vtabung);
}

float luas(float r)
{

ls = phi * r * r;
return (ls);
}





#include<stdio.h>
float maksimum(float a, float b, float c);
float a,b,c, max;

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

maksimum(a,b,c);

printf("max = %f",max);
}
float maksimum(float a, float b, float c)
{
if (a>b && a>c)
max = a;
if (b>a && b>c)
max = b;
if (c>a && c>b)
max = c;
return (max);
}





#include <stdio.h>

float titik (int p1x, int p2x, int p1y, int p2y);
int p1x, int p2x, int p1y, int p2y;
int ttgx, ttgy;

int main()
{
printf("p1(x,y) = ");scanf("%d,%d",&p1x,&p1y);
printf("p2(x,y) = ");scanf("%d,%d",&p2x,&p2y);

titik (p1x,p2x,p1y,p2y);

printf("(x,y) = (%d,%d)",ttgx,ttgy);

}


float titik (int p1x, int p2x, int p1y, int p2y)
{
ttgx = p2x - p1x;
ttgy = p2y - p1y;

}





#include <stdio.h>

float bintang(int i,int j,int n);
int i,j,n;
void main()
{

printf("n = ");scanf("%d",&n);

bintang(i,j,n);

}

float bintang(int i,int j,int n)
{
for(i=1; i<=n;i++)
{
for (j=1;j<=i;j++)
printf("*");
printf("\n");
}
}





#include<stdio.h>

typedef struct {int x;int y;}titik;

titik p1,p2,ttg;

float ttengah(titik p1,titik p2);

int main()
{
printf("p1(x,y) = ");scanf("%d,%d",&p1.x,&p1.y);
printf("p2(x,y) = ");scanf("%d,%d",&p2.x,&p2.y);

ttengah(p1,p2);

printf("titik tengah (x,y) = %d,%d",ttg.x,ttg.y);
}

float ttengah(titik p1,titik p2)
{
ttg.x = p2.x - p1.x;
ttg.y = p2.y - p1.y;

return (ttg.x, ttg.y);
}






#include <stdio.h>
float luassg3(float a, float t);

int main()
{

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

luassg3(a,t);

printf(" luas = %f",luas);

}

float luassg3(float a, float t)
{

luas = (a*t)/2;
return (luas);
}



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