Certainly! Here's a simple pseudocode to find the greatest of two numbers:
1. Start
2. Input first number as num1
3. Input second number as num2
4. If num1 is greater than num2
5. Display num1 as the greatest number
6. Else
7. Display num2 as the greatest number
8. End
This pseudocode first takes two numbers as input, then compares them using an if-else statement to determine which is greater, and finally displays the greatest number.
#include
using namespacestd;
int main()
{
//declaration of your numbers
double firstNumber = 0, secondNumber = 0;
cout << "Enter your first number: ";
cin >> firstNumber;
cout << "Enter your second number: ";
cin >> secondNumber;
if (firstNumber > secondNumber)
{
cout << "First number is greater!\n";
}
else if (firstNumber < secondNumber)
{
cout << "Second number is greater!\n";
}
else
{
cout << "The number are equal!\n";
}
cin.get();
return 0;
}
#include<iostream>
using namespace std;
class num
{
friend num& largest(num& a, num& b);
friend ostream& operator<<(ostream&, num&);
public:
num (int data=0): m_data(data){}
bool operator< (const num& other) { return m_data<other.m_data; }
private:
int m_data;
};
num& largest (num& a, num& b) { return a<b?b:a; }
ostream& operator<< (ostream& os, num& n) { os << n.m_data; return os; }
int main()
{
num x = 42;
num y = 24;
cout << "The largest of " << x << " and " << y << " is " << largest (x,y) << endl;
}
Pseudo code+factorial
Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers
Algorithm Step1: Read A, B, C Step2: If A > B is True, then check whether A > C, if yes then A is greatest otherwise C is greatest Step3: If A > B is False, then check whether B > C, if yes then B is greatest otherwise C is greatest Give the Flowchart Answer
draw a flowchart to find the biggest number among the 3 numbers
jgfujtf
Yes
Pseudo code+factorial
to find area and perimeter of a rectangle
2.2.3 and
One can find information about Pseudocode online in various websites. Some of them include the following: Wikipedia, Stack Overflow or Stack Exchange.
The greatest common multiple of any two numbers is infinite.
Write the factors of the first number in the left circle. Write the factors of the second number in the right circle. Write the numbers that are the same in each individual circle in the space where they intersect.
Oh, what a happy little question! To find the even numbers between 1 and 100, we can simply start at 2 and then add 2 each time until we reach 100. In pseudocode, it would look something like this: for i from 2 to 100 step 2 output i Just like painting a beautiful landscape, take your time and enjoy the process of finding those even numbers.
You need at least two numbers to find a GCF.
You can't find the greatest common multiple in any amount of numbers, the number would be infinite.
Relax. There is no such thing as the "greatest" one.
Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers