Home / Programs / The packing department of a television vision set manufacturer has to prepare a requisition note listing the number of different boxes required for the different TV models that it has received from the production department. The list prepared has to be forwarded to the stores department so that the required boxes are issued to the packing department. The category and the number of boxes required for each type of TV model is given as follows:
Programming Example

The packing department of a television vision set manufacturer has to prepare a requisition note listing the number of different boxes required for the different TV models that it has received from the production department. The list prepared has to be forwarded to the stores department so that the required boxes are issued to the packing department. The category and the number of boxes required for each type of TV model is given as follows:

👁 1,622 Views
💻 Practical Program
📘 Step by Step Learning
Problem statement: The packing department of a television vision set manufacturer has to prepare a requisition note listing the number of different boxes required for the different TV models that it h

Program Code

<table class="table table-hover ">
<tbody>
<tr class="danger">
<td>Model&nbsp;Type</td>
<td>Box Type</td>
<td>Numbers</td>
</tr>
<tr class="info">
<td>TV-LCD 17</td>
<td>1</td>
<td>98</td>
</tr>
<tr>
<td>TV-LCD 22</td>
<td>2</td>
<td>79</td>
</tr>
<tr class="warning">
<td>TV-LCD 26</td>
<td>3</td>
<td>65</td>
</tr>
<tr>
<td>TV-LCD 32</td>
<td>4</td>
<td>43</td>
</tr>
<tr class="danger">
<td>TV-LCD 36</td>
<td>5</td>
<td>17</td>
</tr>
</tbody>
</table> 
/*
 Program: 
  
 Author: www.atnyla.com  
 
*/ 

#include "stdio.h" 
int main()
{
 int tv17box,tv22box,tv26box,tv32box,tv37box;/* Box Types */
 int tv17num,tv22num,tv26num,tv32num,tv37num;/* Number of TV sets to be packed */
 
 /* Box Types */
 
 tv17box = 1;
 tv22box = 2;
 tv26box = 3;
 tv32box = 4;
 tv37box = 2;
 printf("\nEnter number of TV-LCD 17 model to be packed:");                  
 scanf("%d",&tv17num);
 printf("\nEnter number of TV-LCD 22 model to be packed:");
 scanf("%d",&tv22num);
 printf("\nEnter number of TV-LCD 26 model to be packed:");
 scanf("%d",&tv26num);
 printf("\nEnter number of TV-LCD 32 model to be packed:");
 scanf("%d",&tv32num);
 printf("\nEnter number of TV-LCD 37 model to be packed:");
 scanf("%d",&tv37num);
 
 printf("\n      **** Requisition Note ****  ");
 printf("\n ========================================");
 
 printf("\n     TV Model   |  Box type  |  Numbers ");
 printf("\n                |  required  |   ");
 
 printf("\n ========================================");
 
 printf("\n\n   TV-LCD 17         %d           %d",tv17box,tv17num);
 printf("\n     TV-LCD 22         %d           %d",tv22box,tv22num);
 printf("\n     TV-LCD 26         %d           %d",tv26box,tv26num);
 printf("\n     TV-LCD 32         %d           %d",tv32box,tv32num);
 printf("\n     TV-LCD 37         %d           %d",tv37box,tv37num);
 printf("\n ========================================");
 
 return 0;
 
 } 

Output


Enter number of TV-LCD 17 model to be packed:1

Enter number of TV-LCD 22 model to be packed:2

Enter number of TV-LCD 26 model to be packed:3

Enter number of TV-LCD 32 model to be packed:1

Enter number of TV-LCD 37 model to be packed:3

      **** Requisition Note ****
 ========================================
     TV Model   |  Box type  |  Numbers
                |  required  |
 ========================================

   TV-LCD 17         1           1
     TV-LCD 22         2           2
     TV-LCD 26         3           3
     TV-LCD 32         4           1
     TV-LCD 37         2           3
 ========================================Press any key to continue . . .

Explanation

None

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.