#include<iostream>
int main()
{
float input1, input2, input3;
float smallest;
else
{
smallest = input3;
cout << "The smallest number is: " << smallest;
}
return 0;
}
1
SORTING STRINGS
#include<iostream>
int main()
{
string s1, s2, s3;
2
else
{
cout << s3 << "\n";
cout << s1 << "\n";
}
}
else
{
cout << s3 << "\n";
else
{
cout << s2 << "\n";
cout << s1 << "\n";
}
}
return 0;
}
3
INTEGER TO DIGITS
#include<iostream>
int main()
{
int input;
cout << "Enter an integer: ";
cin >> input;
if(input < 0)
{
input *= -1;
}
4
else if(input >= 100000 && input < 1000000)
{
digits = 6;
}
else
{
cout << "Input is greater than 10 billion.";
return 0;
}
return 0;
}
5
MONTHS TO NUMBER OF DAYS CONVERSION
#include<iostream>
using namespace std;
int main()
{
cout << "Enter a month(1-12): ";
int month;
cin >> month;
int days;
if(month == 4 || month == 6 || month == 9 || month == 11)
{
days = 30;
}
else if(month == 2)
{
days = 28;
}
else
{
days = 31;
}
return 0;
6
}