Answers for "print 5 table in c++"

C++
1

print 5 table in c++

#include <iostream>
using namespace std;
int main(){
int num=1;
 
 for(num=1;num<=10;num++)
 cout<<"5*"<<num<<"="<<5*num<<endl;
}
Posted by: Guest on October-17-2021
0

print 5 table in c++

#include <iostream>
using namespace std;

int main()
{
    int n;

    cout << "Enter a positive integer: ";
    cin >> n;

    for (int i = 1; i <= 10; ++i) {
        cout << n << " * " << i << " = " << n * i << endl;
    }
    
    return 0;
}
Posted by: Guest on October-17-2021

Browse Popular Code Answers by Language