C++ If (lebih besar atau lebih kecil)

//lh3.googleusercontent.com/-K5UKWzgJhmU/AAAAAAAAAAI/AAAAAAAACdI/CN3nwiBZsGE/s512-c/photo.jpg
November 19, 2016




tampilan di samping manunjukkan apakah angka pertama lebih besar atau lebih kecil.

 #include<iostream>
using namespace std;
main()
{
int n1,n2;
cout<<"Nilai 1 = ";
cin>>n1;
cout<<"Nilai 2 = ";
cin>>n2;
if(n1<n2)
{
cout<<n1<<"<"<<n2;
}
else
{cout<<n1<<">"<<n2;
}
}


Related Post

SUBSCRIBE TO OUR NEWSLETTER

closed