Loops – Arithmetic – Problem #1
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Difficulty: Medium
Problem Statement
A user executes a program and it asks to enter an integer. When s(he) enters 7 then the program prints the following 7*7 square matrix. Write a C program which can read any positive integer (<=7) and perform this. Use loop to execute this operation and achieve proper alignment. 1 2 3 4 5. 6. 7 2 4 12 48 240 1440 10080 3 6 18 72 360 2160 15120 4 8 24 96 480 2880 20160 5 10 30 120 600 3600 25100 6 12 36 144 720 4320 30240 7 14 42 168 840 5040 35280