Skip to main content

Posts

Showing posts from February 21, 2018

C++: Write a program to print the largest of 3 number using conditional operator

Write a program to print the largest of 3 number using conditional operator #include<iostream> using namespace std; int main() {     int a, b, c;     cout << "Enter 3 no\n";     cin>>a>>b>>c;     int big =  ( a>b && a>c )?a:(b>c?b:c);     cout<<"\nAmong "<<a<<" , "<<b<<" , "<<c<<" Biggest is "<<big<<endl;     return 0; }

C++: Write a Program to Find the S.I given Principal = 100 , take rate and time from the User

Write a Program to find the S.I given Principal = 100 , take rate and time from the User #include<iostream> using namespace std; int main() {     int principle = 100;     int rate, time, intrest;     cout << "Enter rate= ";     cin>>rate;     cout<<"Enter time= ";     cin>>time;     intrest=(principle*time*rate)/100;     cout <<"The intrest rate is = "<<intrest<<endl; }