Menghitung Hasil vt+1/2at

Posted: April 18, 2010 in Daspro
Tags:

#include<conio.h>

#include<iostream.h>

#include<windows.h>

void setcolor(unsigned short color)

{

HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);

SetConsoleTextAttribute(hCon,color);

}

main()

{

float v,a,t,s;

clrscr;

setcolor(1);cout<<“Masukan Nilai v : “;cin>>v;

setcolor(1);cout<<“Masukan Nilai a : “;cin>>a;

setcolor(1);cout<<“Masukan Nilai t : “;cin>>t;

s=(v*t)+(0.5*a*(t*t));

setcolor(2);cout<<“Hasil dari vt+1/2at = “<<s;

getch();

}

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