0

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

11th Nov 2019, 11:03 AM
Omar Mahrous
Omar Mahrous - avatar
5 odpowiedzi
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; } }
11th Nov 2019, 11:39 AM
Omar Mahrous
Omar Mahrous - avatar
0
I need it by if else not by for
11th Nov 2019, 11:40 AM
Omar Mahrous
Omar Mahrous - avatar
0
It's for my sheet😇
11th Nov 2019, 11:59 AM
Omar Mahrous
Omar Mahrous - avatar