#include <iostream.h>
#include <math.h>
#include<conio.h>
#define PI 3.14159265
void main ()
{
double param, result;
param = 45.0;
result = tan (param*PI/180);
cout<<”tan 45 = “<<result<<endl;
getch();
}
This is default featured slide 1 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured slide 2 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured slide 3 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured slide 4 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured slide 5 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
Wednesday, May 2, 2012
Program Mencari Nilai Tangen (TAN) dengan math.h di C++
Program Mencari Nilai Cosinus (COS) dengan math.h di C++
#include<math.h>
#include <conio.h>
void main(){
clrscr();
int a;
const float phi =3.14159265;
float hasil;
cout<<"masukan a: "; cin>>a;
hasil = cos (a*phi/180);
cout<<"hasilnya= "<<hasil<<endl;
getch();
}
Program Mencari Nilai Sinus (SIN) dengan math.h di C++
#include<iostream.h>
#include<math.h>
#include <conio.h>
void main(){
clrscr();
int a;
const float phi =3.14159265;
float hasil;
cout<<"masukan a: "; cin>>a;
hasil = sin (a*phi/180);
cout<<"hasilnya = "<<hasil<<endl;
getch();
}
Program Mencari Nilai Absolute (ABS) dengan math.h di C++
#include <iostream.h>
#include <math.h>
#include <conio.h>
void main ()
{
int a;
clrscr();
cout<<"Masukan Nilai Mutlak: ";
cin>> a;
cout<<"Nilai Mutlaknya adalah: "<<abs (a);
getch();
}
Tuesday, May 1, 2012
Program Menggabungkan 2 Kata (STRCAT) di C++
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
char kata1[100];
char kata2[100];
clrscr();
cout<<"Masukan kata1:"; cin>>kata1;
cout<<"masukan kata2:"; cin>>kata2;
strcat(kata1,kata2);
cout<<"penggabungan kedua kata adalah "<<kata1;
getch();
}





