#include <iostream.h>
#include <conio.h>
void main()
{
int a,b,c;
cout <<"imput nilai a;";cin >> a;
cout <<"imput nilai b;";cin >> b;
cout <<"imput nilai c;";cin >> c;
cout <<"volume balok adalah " <<a*b*c <<endl;
getch();
}
---------------------------------------------------------
#include <stdio.h>
#include <conio.h>
void main()
{
char n[] = "nama saya";
puts ("aaa aa rrrrrrrr iii sssss ");
puts ("aaa aaa rrrrrrrr iii ss ");
puts ("aaa aaa rrr rr iii ss ");
puts ("aaaaaaaaa rrr rr iii ssssss ");
puts ("aaa aaa rrr iii sssssss ");
puts ("aaa aaa rrr iii ss ");
puts ("aaa aaa rrr iii ssssss ");
puts(n);
getch();
}
-------------------------------------------------------------
#include <iostream.h>
#include <conio.h>
void main()
{
int r,s,t,o;
float h;
char a[10];
float z;
cout <<"nama siswa ariz:";
cin >> a;
cout<<"nilai pertandingan 1:";
cin>>r;
cout<<"nilai pertandingan 2:";
cin>>s;
cout<<"nilai pertandingan 3:";
cin>>t;
o=r+s+t;
cout<< o<< endl;
z=o/3;
cout<< z<< endl;
getch();
}
---------------------------------------------------------------
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main()
{
char a[30]= " teknik informatika ";
char b[30]= "sistem informatika ";
strcpy(a,b);
strupr(b);
cout<< "karakter a : "<< a << endl;
cout<< "karaktear b : "<< b << endl;
getch();
}
---------------------------------------------------------------
#include <iostream.h>
#include <conio.h>
void main()
{
int a,b,c;
cout << "input A;"; cin >> a;
cout << "input B;"; cin >> b;
cout << " hasil penjumlahan adalah:" << a+b << endl;
cout << " hasil pengurangan adalah:" << a-b << endl;
cout << " hasil perkalian adalah:" << a*b << endl;
cout << " hasil pembagian adalah:" << a/b << endl;
getch();
}
--------------------------------------------------------------------------
volume balok
#include <iostream.h>
#include <conio.h>
void main()
{
int a,b,c,d;
cout <<"input A;"; cin >> a;
cout <<"input B;"; cin >> b;
cout <<"input C;"; cin >> c;
cout <<" volume balok adalah:" << a*b*c << endl;
getch();
}
-------------------------------------------------------------------
rata-rata
#include <iostream.h>
#include <conio.h>
void main ()
{
int s,d,e;
float g;
char b,a[20];
cout << "siswa yang bernama:";
cin.getline(a, sizeof(a));
cout << "nilai pertandingan 1 adalah:";
cin >>s;
cout << "nilai pertandingan 2 adalah:";
cin >>d;
cout << "memperoleh nilai rata-rata:" << (s+d)/2 << endl;
cout << "dari hasil perlombaan yang diikutinya" <<endl;
getch();
}
==================================================
#include <iostream.h>
#include <conio.h>
void main ()
{
int s,d,e;
float g;
char b,a[20];
cout << "siswa yang bernama:";
cin.getline(a, sizeof(a));
cout << "=====================" <<endl;
cout << "nilai pertandingan 1 adalah:";
cin >>s;
cout << "nilai pertandingan 2 adalah:";
cin >>d;
g = (s+d)/2;
cout << "memperoleh nilai rata-rata:"<< g << endl;
cout << "====================================" <<endl;
if (g>=65)
cout << "anda lolos babak berikutnya" <<endl;
else
cout << "anda tidak lolos ke babak berikutnya" <<endl;
getch();
}
===============================================
persegi panjang
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c;
cout <<"luas dan keliling persegi panjang ="<<endl;
cout <<"masukan panjang ="; cin >>b;
cout <<"masukam lebar ="; cin >>c;
cout <<"masukan persegi panjang ="<< b*c <<endl;
getch();
}
===============================================
#include <conio.h>
#include <iostream.h>
void main()
{
int a,b,c,d,e.f,g,h;
cout<<"============================"<<endl;
cout<<" MINI MARKET NH "<<endl;
cout<<"============================"<<endl;
cout<<" 1. Barang1 :Rp" ;cin >>a;
cout<<" 2. barang2 :Rp" ;cin >>b;
cout<<" 3. barang3 :Rp" ;cin >>c;
cout<<" 4. barang4 :Rp" ;cin >>d;
cout<<" 5. barang5 :Rp" ;cin >>e;
cout<<"============================"<<endl;
cout<<"TOTAL BLANJA :Rp" <<a+b+c+d+e<<endl;
if (f>=15000 & f<= 25000
cout<<"Disc(%) :Rp" 10/100)-f <<endl;
else if f>=100 & a>=150);
cout<<"Total bayar :Rp" <<g <<endl;
getch();
}
====================================================
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main()
{
char A[100]="SEKOLAH TINGGI MANAJEMEN INFORMATIKA";
char B[50];
strcpy(B,A);
strrev(B);
strrev(B);
cout<<"SEKOLAH TINGGI MANAJEMEN INFORMATIKA"<<endl;
getch();
}
==========================================================
Terbaru dan Populer
Tidak ada komentar:
Posting Komentar