xxxxxxxxxx
if (x > 0 && y != 10)
z = y – x;
else
z = x + y;
xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
int number;
cout << "Enter an integer: ";
cin >> number;
cout << "You entered " << number;
return 0;
}
xxxxxxxxxx
int fib(int n) {
if (n==0)
return 0;
else if (n == 1)
return 1;
else
return fib(n−1) + fib(n−2);
}
xxxxxxxxxx
main()
{
double num1, num2, quotient;
cout << "Enter a number: ";
cin >> num1;
cout << "Enter another number: ";
cin >> num2;
if (num2 == 0)
{
cout << "Division by zero is not possible.\n";
cout << "Please run the program again ";
cout << "and enter a number besides zeroo.\n";
}
else
{
quotient = num1/num2;
cout << "The quotient of " << num1 ;
cout << " divided by " << num2 << " is ";
cout << quotient << endl;
xxxxxxxxxx
main()
{
double num1, num2, quotient;
cout << "Enter a number: ";
cin >> num1;
cout << "Enter another number: ";
cin >> num2;
if (num2 == 0)
{
cout << "Division by zero is not possible.\n";
cout << "Please run the program again ";
cout << "and enter a number besides zeroo.\n";
}
else
{
quotient = num1/num2;
cout << "The quotient of " << num1 ;
cout << " divided by " << num2 << " is ";
cout << quotient << endl;
xxxxxxxxxx
#include <iostream>
using namespace std;
int main()
{
{
cout << "Hello world!" << endl;
return 0;
}
}