SlideShare a Scribd company logo
1 of 1
#include <iostream.h>
#define phi 3.14
void main ()
{
int a;
float t,r,hasil,keliling;
cout<<"keterangan : " <<endl;
cout<<"Angka 1 untuk menghitung LUAS SEGITIGA " <<endl;
cout<<"Angka 2 Untuk Menghitung KELILING LINGKARAN " <<endl;
cout<<"Masukan Pilihan Anda = ";
cin>>a;
switch (a)
{
case 1:
{
cout<<"Menghitung Luas Segitiga" <<endl;
cout<<"masukan alas = ";
cin>>a;
cout<<"masukan tinggi = ";
cin>>t;
hasil=a*t/2;
cout<<"hasil ";
cout<<hasil;
break;
}
case 2:
{
cout<<"menghitung keliling lingkaran" <<endl;
cout<<"masukan jari-jari = ";
cin>>r;
keliling = phi * r * r;
cout<<"keliling lingkaran = ";
cout<<keliling;
break;
}
}
}
#include <iostream.h>
void main ()
{
float nilai;
cout<<"masukan Nilai IPK ";
cin>>nilai;
if (nilai>=3)
cout<<"A" <<endl;
else if(nilai<3&&nilai>=2)
cout<<"B" <<endl;
else
cout<<"C";
}

More Related Content

What's hot

Class array
Class arrayClass array
Class arraynky92
 
Coding with Vim
Coding with VimCoding with Vim
Coding with VimEnzo Wang
 
Intro to c programming
Intro to c programmingIntro to c programming
Intro to c programmingPrabhu Govind
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklistilsamaryum
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"OdessaJS Conf
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changeshayato
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureanishgoel
 
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"OdessaJS Conf
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...hwbloom27
 

What's hot (20)

Sol9
Sol9Sol9
Sol9
 
Class array
Class arrayClass array
Class array
 
C++ TUTORIAL 5
C++ TUTORIAL 5C++ TUTORIAL 5
C++ TUTORIAL 5
 
Coding with Vim
Coding with VimCoding with Vim
Coding with Vim
 
Intro to c programming
Intro to c programmingIntro to c programming
Intro to c programming
 
timingExercise
timingExercisetimingExercise
timingExercise
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklist
 
CQL 实现
CQL 实现CQL 实现
CQL 实现
 
Problemas de Arreglos en c++
Problemas de Arreglos en c++Problemas de Arreglos en c++
Problemas de Arreglos en c++
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
 
Sample sql
Sample sqlSample sql
Sample sql
 
Matuura cpp
Matuura cppMatuura cpp
Matuura cpp
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lecture
 
Sol6
Sol6Sol6
Sol6
 
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
 
Vcs23
Vcs23Vcs23
Vcs23
 
Ooprc4 b
Ooprc4 bOoprc4 b
Ooprc4 b
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
 
Dex and Uniswap
Dex and UniswapDex and Uniswap
Dex and Uniswap
 

Viewers also liked

навыки 21 века
навыки 21 веканавыки 21 века
навыки 21 векаaydawka2000
 
Lgpl license
Lgpl licenseLgpl license
Lgpl licensejustinedm
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceMind The Firebird
 
Núcleo slides para formação em maio de 2013
Núcleo   slides para formação em maio de 2013Núcleo   slides para formação em maio de 2013
Núcleo slides para formação em maio de 2013Carlos Junior
 
Plan de vida santiago vivas topón
Plan de vida   santiago vivas topón Plan de vida   santiago vivas topón
Plan de vida santiago vivas topón Santiago Vivas
 
Universidad de Guayaquil
Universidad de GuayaquilUniversidad de Guayaquil
Universidad de GuayaquilGise Estefania
 

Viewers also liked (11)

Jcj u4 a1
Jcj u4 a1Jcj u4 a1
Jcj u4 a1
 
Apresentação2
Apresentação2Apresentação2
Apresentação2
 
навыки 21 века
навыки 21 веканавыки 21 века
навыки 21 века
 
Lgpl license
Lgpl licenseLgpl license
Lgpl license
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performance
 
Núcleo slides para formação em maio de 2013
Núcleo   slides para formação em maio de 2013Núcleo   slides para formação em maio de 2013
Núcleo slides para formação em maio de 2013
 
Expocompu
ExpocompuExpocompu
Expocompu
 
certificates
certificatescertificates
certificates
 
Plan de vida santiago vivas topón
Plan de vida   santiago vivas topón Plan de vida   santiago vivas topón
Plan de vida santiago vivas topón
 
Universidad de Guayaquil
Universidad de GuayaquilUniversidad de Guayaquil
Universidad de Guayaquil
 
Lessonplan
LessonplanLessonplan
Lessonplan
 

Similar to C++ programs to calculate area & circumference

C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.pptLokeshK66
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++Dendi Riadi
 
Start with the inclusion of libraries#include iostream .docx
 Start with the inclusion of libraries#include iostream .docx Start with the inclusion of libraries#include iostream .docx
Start with the inclusion of libraries#include iostream .docxMARRY7
 
Pointers in c++ programming presentation
Pointers in c++ programming presentationPointers in c++ programming presentation
Pointers in c++ programming presentationSourabhGour9
 
Bangun datar dan bangun ruang
Bangun datar dan bangun ruangBangun datar dan bangun ruang
Bangun datar dan bangun ruangSanSan Yagyoo
 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6phoe3
 
Assignement c++
Assignement c++Assignement c++
Assignement c++Syed Umair
 
Program(Output)
Program(Output)Program(Output)
Program(Output)princy75
 
Please use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdfPlease use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdfseoagam1
 

Similar to C++ programs to calculate area & circumference (20)

C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
DEV C++
DEV C++DEV C++
DEV C++
 
Dev C++ Code Basic Loop
Dev C++ Code Basic LoopDev C++ Code Basic Loop
Dev C++ Code Basic Loop
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.ppt
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
Project in programming
Project in programmingProject in programming
Project in programming
 
Opp compile
Opp compileOpp compile
Opp compile
 
Ch4
Ch4Ch4
Ch4
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
 
Start with the inclusion of libraries#include iostream .docx
 Start with the inclusion of libraries#include iostream .docx Start with the inclusion of libraries#include iostream .docx
Start with the inclusion of libraries#include iostream .docx
 
Pointers in c++ programming presentation
Pointers in c++ programming presentationPointers in c++ programming presentation
Pointers in c++ programming presentation
 
Oopppp
OoppppOopppp
Oopppp
 
Bangun datar dan bangun ruang
Bangun datar dan bangun ruangBangun datar dan bangun ruang
Bangun datar dan bangun ruang
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6
 
Assignement c++
Assignement c++Assignement c++
Assignement c++
 
Program(Output)
Program(Output)Program(Output)
Program(Output)
 
Please use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdfPlease use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdf
 

C++ programs to calculate area & circumference

  • 1. #include <iostream.h> #define phi 3.14 void main () { int a; float t,r,hasil,keliling; cout<<"keterangan : " <<endl; cout<<"Angka 1 untuk menghitung LUAS SEGITIGA " <<endl; cout<<"Angka 2 Untuk Menghitung KELILING LINGKARAN " <<endl; cout<<"Masukan Pilihan Anda = "; cin>>a; switch (a) { case 1: { cout<<"Menghitung Luas Segitiga" <<endl; cout<<"masukan alas = "; cin>>a; cout<<"masukan tinggi = "; cin>>t; hasil=a*t/2; cout<<"hasil "; cout<<hasil; break; } case 2: { cout<<"menghitung keliling lingkaran" <<endl; cout<<"masukan jari-jari = "; cin>>r; keliling = phi * r * r; cout<<"keliling lingkaran = "; cout<<keliling; break; } } } #include <iostream.h> void main () { float nilai; cout<<"masukan Nilai IPK "; cin>>nilai; if (nilai>=3) cout<<"A" <<endl; else if(nilai<3&&nilai>=2) cout<<"B" <<endl; else cout<<"C"; }