How to make a c++ program of multiplication table using if else conditions | SoloLearn: Learn to code for FREE!

0

How to make a c++ program of multiplication table using if else conditions

11/11/2019 11:03:59 AM

Omar Mahrous

5 Answers

New Answer

+1

Can you tell how much C++ have you covered in your course? Also can you tell what information you would need to write a multiplication table of any number (just think about the things we take it for granted if we were to write a multiplication table on paper) And are you sure it's only if-else and no loops or functions at all.

0

#include <iostream> using namespace std; int main() { int j, i, n; cout << "\n\n Display the multipliaction table vertically from 1 to n:\n"; cout << "-------------------------------------------------------------\n"; cout << "Input the number upto 5: "; cin >> n; cout << "Multiplication table from 1 to " << n << endl; for (i = 1; i <= 10; i++) { for (j = 1; j <= n; j++) { if (j <= n - 1) cout << j << "x" << i << "= " << i * j; else cout << j << "x" << i << "= " << i * j; } cout << endl; } }

0

I need it by if else not by for

0

That is why i asked you only if-else and no use of loops or functions. For the rest of the information you never know whom you are dealing with, I have seen all sorts of people here 😉 Unless you are using recursion or "goto" there is no point in using if-else.

0

It's for my sheet😇