0% found this document useful (0 votes)
1 views2 pages

Program Logic

The document is a C++ program that generates multiplication tables based on user input for the initial and final values, as well as the range. It uses nested loops to calculate and display the multiplication results for each integer in the specified range. The program prompts the user for input and prints the multiplication table for each integer between the initial and final values provided.

Uploaded by

Kashif Majeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views2 pages

Program Logic

The document is a C++ program that generates multiplication tables based on user input for the initial and final values, as well as the range. It uses nested loops to calculate and display the multiplication results for each integer in the specified range. The program prompts the user for input and prints the multiplication table for each integer between the initial and final values provided.

Uploaded by

Kashif Majeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

//header files for input output functionality

#include<iostream>

#include<iomanip>

#include<conio.h>

using namespace std;

int main()

//variables declared, variables name can be any name but must be logical / meaningful

//int stands for integer

//inix stands for initial value of x, iniy stands for initial value of y, inij stands for initial value of j, inik
stands for initial value of k

int inix,iniy,inij,inik,y;

cout<<"Enter initial value for table"<<endl; //prints message for taking input and goto next line

cin>>inix; //takes the input from user

cout<<"Enter Final value for table"<<endl; //prints message for taking input and goto next line

cin>>iniy; //takes the input from user

cout<<"Enter range"<<endl; //prints message for taking input and goto next line

cin>>inik; //takes the input from user

for(y=inix;inix<=iniy;inix++) //first loop initial value e.g 2

for(inij=1;inij<=inik;inij++) //second loop will start count from 1 to the range given for e.g 10 so it will
loop from 1 to 10

//here it will generate output

//for value x=2 we will have

//2x1=2, 2x2=4…. And so on

cout<<inix<<" "<<" x "<<" "<<inij<<" "<<" = "<< " "<<inix*inij<<endl;

// after 10 iterations loop number 2 ends and control is transferred to loop number 1, value is increased
from 2 to 3, condition is checked whether 3 <=4 condition is true again control is transferred to loop
number 2 and table of 4 is written and so on, when both loops ends the final result is displayed which is
table of 2,3 and 4

You might also like