WFandella
Tuesday, June 4, 2013
Contoh Program Exception Handling C++ (1)
#include<iostream>
using namespace std;
int main(){
double X;
try{
cout<<"masukan sebuah bilangan bulat positif : ";
cin>>X;
if(X<=0)
{
throw X;
}else{
cout<<"Nilai yang di masukan adalah : "<<X;
}
}
catch(double E){
cout<<"program telah menangkap ekspesi yang bernilai : ";
cout<<E;
}
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Link
Contoh Program Menu Gabungan antara Queue & Sorting C++ (Struktur Data)
Mencari Nilai Terkecil Array (C++)
#include<stdio.h> #include<conio.h> int main(void){ int nilai[3];
Contoh program Fibonacci search (Struktur Data)
Good Luck.. #include <stdio.h> #include <conio.h> #include<iostream.h> int main() { int i,j,F0,F1,Fibo,n,m,N,Flag...
No comments:
Post a Comment