Write the C++ code using nested for loops that prints the product of the outer loop counter and the inner loop counter; one per line. The outer loop counter should go from 1 to 8 and the inner loop counter should go from the value of the outer loop counter to 10. Both counters should increment by 1. Use outer for the outer loop counter and inner for the inner loop counter.
Please find below code and don't forget to give a Like.
Please refer below screenshot for code and output.
Code:
#include <iostream>
using namespace std;
int main()
{
int outer=0,inner=0;
for(int i=1;i<=8;i++){
outer++;
for(int j=i;j<=10;j++){
inner++;
cout<<outer*inner<<"\n";
}
}
return 0;
}
Output:
Get Answers For Free
Most questions answered within 1 hours.