SlideShare a Scribd company logo
CODE:
#include
#include
struct task{//process
int id;//pid
int bt;//burst time
int at;//arrival time
int pr;//priority
};
typedef struct task Task;
typedef Task *TaskPtr;
struct qnode{//a node in the run/ready queue
Task data;//process
struct qnode *nextPtr;
};
typedef struct qnode Qnode;
typedef Qnode *QnodePtr;
void enqueue(QnodePtr *headPtr, QnodePtr *tailPtr,Task task);
Task dequeue(QnodePtr *headPtr, QnodePtr *tailPtr);
int isEmpty(QnodePtr headPtr);
void enqueue(QnodePtr *headPtr, QnodePtr *tailPtr,Task task){
QnodePtr newNodePtr = malloc( sizeof( Qnode));
if(newNodePtr !=NULL){
newNodePtr->data = task;
newNodePtr->nextPtr = NULL;
}
QnodePtr current = *headPtr, prev = NULL;
while(current!=NULL && task.bt>=(current->data).bt){
prev = current;
current = current->nextPtr;
}
if(prev==NULL){
newNodePtr->nextPtr= *headPtr;
*headPtr=newNodePtr;
}
else{
newNodePtr->nextPtr=prev->nextPtr;
prev->nextPtr=newNodePtr;
}
if(newNodePtr->nextPtr==NULL){
*tailPtr = newNodePtr;
}
}
Task dequeue(QnodePtr *headPtr, QnodePtr *tailPtr){
Task value;
QnodePtr tempPtr;
value = (*headPtr)->data;
tempPtr = *headPtr;
*headPtr = (*headPtr)->nextPtr;
if(*headPtr == NULL){
*tailPtr = NULL;
}
free (tempPtr);
return value;
}
int isEmpty(QnodePtr headPtr){
return headPtr == NULL;
}
///////////////////////////////////////////////
struct event{//an event event
int type;//event type 0:arrival, 1: departure
int time;//event time
Task task;//the process
};
typedef struct event Event;
typedef Event *EventPtr;
struct eventQnode{//an node in the events list
Event data;//the event
struct eventQnode *nextPtr;
};
typedef struct eventQnode EventQnode;
typedef EventQnode *EventQnodePtr;
void enqueueevent(EventQnodePtr *headPtr, EventQnodePtr *tailPtr,Event e);
Event dequeueevent(EventQnodePtr *headPtr, EventQnodePtr *tailPtr);
int isEmptyEQ(EventQnodePtr headPtr);
void displayEvents(EventQnodePtr currentPtr);
void enqueueevent(EventQnodePtr *headPtr, EventQnodePtr *tailPtr,Event se){
EventQnodePtr newNodePtr = malloc( sizeof( EventQnode));
if(newNodePtr !=NULL){
newNodePtr->data = se;
newNodePtr->nextPtr = NULL;
}
EventQnodePtr current = *headPtr, prev = NULL;
while(current!=NULL && se.time>(current->data).time){//find the insert position in order of
time
prev = current;
current = current->nextPtr;
}
while(current!=NULL && se.time==(current->data).time && se.type<(current-
>data).type){//then find the insert position in order of event's type
prev = current;
current = current->nextPtr;
}
if(prev==NULL){
newNodePtr->nextPtr= *headPtr;
*headPtr=newNodePtr;
}
else{
newNodePtr->nextPtr=prev->nextPtr;
prev->nextPtr=newNodePtr;
}
if(newNodePtr->nextPtr==NULL){
*tailPtr = newNodePtr;
}
}
Event dequeueevent(EventQnodePtr *headPtr, EventQnodePtr *tailPtr){
Event value;
EventQnodePtr tempPtr;
value = (*headPtr)->data;
tempPtr = *headPtr;
*headPtr = (*headPtr)->nextPtr;
if(*headPtr == NULL){
*tailPtr = NULL;
}
free (tempPtr);
return value;
}
int isEmptyEQ(EventQnodePtr headPtr){
return headPtr == NULL;
}
void displayEvents(EventQnodePtr currentPtr){
if(currentPtr==NULL)
printf("The event list is empty ... ");
else{
printf("The event list is: ");
Event tempevent;
while(currentPtr!=NULL){
printf(" time: %d, type : %d : task(id:%d,bt:%d) ",
(currentPtr->data).time, (currentPtr->data).type, (currentPtr->data).task.at,(currentPtr-
>data).task.bt);
currentPtr=currentPtr->nextPtr;
}
}
}
///////////////////////////////////////////////
const int MAXTASKS = 10;
const int MAXBURSTTIME = 70;
const int IAT = 30;
void main(){
QnodePtr rqheadPtr=NULL, rqtailPtr=NULL;//the run/ready queue
EventQnodePtr eventsQheadPtr=NULL, eventsQtailPtr=NULL;//the event queue/list
Task task;//the process structure
Event event;//the event structure
int prevat = 0, i;//set the previous arrival time to zero
for(i=0;i
Solution
#include
#include
#include
class cpuschedule
{
int n,bu[20];
float twt,awt,wt[20],tat[20];
public:
void Getdata();
void fcfs();
void sjf();
void roundrobin();
};
//Getting no of processes and Burst time
void cpuschedule::Getdata()
{
int i;
cout<<“Enter the no of processes:”;
cin>>n;
for(i=1;i<=n;i++)
{
cout<<“ Enter The BurstTime for Process p”<>bu[i];
}
}
//First come First served Algorithm
void cpuschedule::fcfs()
{
int i,b[10];
float sum=0.0;
twt=0.0;
for(i=1;i<=n;i++)
{
b[i]=bu[i];
cout<<“ Burst time for process p”<=1;i–)
{
for(j=2;j<=n;j++)
{
if(b[j-1]>b[j])
{
temp=b[j-1];
b[j-1]=b[j];
b[j]=temp;
}
}
}
wt[1]=0;
for(i=2;i<=n;i++)
{
wt[i]=b[i-1]+wt[i-1];
}
for(i=1;i<=n;i++)
{
twt=twt+wt[i];
tat[i]=b[i]+wt[i];
sum+=tat[i];
}
awt=twt/n;
sum=sum/n;
cout<<“ Total Waiting Time=”<>tq;
//TO find the dimension of the Round robin array
m=max/tq+1;
//initializing Round robin array
for(i=1;i<=n;i++)
{
for(j=1;j<=m;j++)
{
Rrobin[i][j]=0;
}
}
//placing value in the Rrobin array
i=1;
while(i<=n)
{
j=1;
while(b[i]>0)
{
if(b[i]>=tq)
{
b[i]=b[i]-tq;
Rrobin[i][j]=tq;
j++;
}
else
{
Rrobin[i][j]=b[i];
b[i]=0;
j++;
}
}
count[i]=j-1;
i++;
}
cout<<“Display”;
for(i=1;i<=n;i++)
{
for(j=1;j<=m;j++)
{
cout<<“ Rr[“<>ch;
getch();
}while(ch<5);
}

More Related Content

Similar to CODE#include stdlib.h #include stdio.hstruct task{proce.pdf (20)

PDF
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
anwarsadath111
 
DOCX
Lab Week 2 Game Programming.docx
teyaj1
 
DOCX
Implement of c &amp; its coding programming by sarmad baloch
Sarmad Baloch
 
PDF
program on string in java Lab file 2 (3-year)
Ankit Gupta
 
DOCX
GIVEN CODE template -typename T- class DList { private- struct Node {.docx
LeonardN9WWelchw
 
PPTX
Using Arbor/ RGraph JS libaries for Data Visualisation
Alex Hardman
 
PDF
Write a C program that reads the words the user types at the command.pdf
SANDEEPARIHANT
 
PDF
#includeiostream struct node {    char value;    struct no.pdf
ankitmobileshop235
 
DOCX
cmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docx
gordienaysmythe
 
PDF
Doubly Linked List
Er. Ganesh Ram Suwal
 
DOCX
d.s.a lab 9.docxjwbwbwbw wvwhwhwjnwnwbwbw
playstore9ha
 
RTF
Sorter
Thomas Knudstrup
 
PDF
In C++ I need help with this method that Im trying to write fillLi.pdf
fantoosh1
 
PDF
solution in c++program Program to implement a queue using two .pdf
brijmote
 
PPTX
class 2.pptxdsafe fnbwfl;d,qgyewbjdkqwd;wd
ankitnegics07
 
PPTX
class 2.pptxdsdhwdhwdbgkjbdqwnddbqsddbbd
ankitnegics07
 
PDF
#include iostream #includeData.h #includePerson.h#in.pdf
annucommunication1
 
PDF
#includeiostream#includecstdio#includecstdlibusing names.pdf
KUNALHARCHANDANI1
 
PDF
C++ Program to Implement Singly Linked List #includei.pdf
anupambedcovers
 
PDF
Please teach me how to fix the errors and where should be modified. .pdf
amarndsons
 
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
anwarsadath111
 
Lab Week 2 Game Programming.docx
teyaj1
 
Implement of c &amp; its coding programming by sarmad baloch
Sarmad Baloch
 
program on string in java Lab file 2 (3-year)
Ankit Gupta
 
GIVEN CODE template -typename T- class DList { private- struct Node {.docx
LeonardN9WWelchw
 
Using Arbor/ RGraph JS libaries for Data Visualisation
Alex Hardman
 
Write a C program that reads the words the user types at the command.pdf
SANDEEPARIHANT
 
#includeiostream struct node {    char value;    struct no.pdf
ankitmobileshop235
 
cmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docx
gordienaysmythe
 
Doubly Linked List
Er. Ganesh Ram Suwal
 
d.s.a lab 9.docxjwbwbwbw wvwhwhwjnwnwbwbw
playstore9ha
 
In C++ I need help with this method that Im trying to write fillLi.pdf
fantoosh1
 
solution in c++program Program to implement a queue using two .pdf
brijmote
 
class 2.pptxdsafe fnbwfl;d,qgyewbjdkqwd;wd
ankitnegics07
 
class 2.pptxdsdhwdhwdbgkjbdqwnddbqsddbbd
ankitnegics07
 
#include iostream #includeData.h #includePerson.h#in.pdf
annucommunication1
 
#includeiostream#includecstdio#includecstdlibusing names.pdf
KUNALHARCHANDANI1
 
C++ Program to Implement Singly Linked List #includei.pdf
anupambedcovers
 
Please teach me how to fix the errors and where should be modified. .pdf
amarndsons
 

More from fathimalinks (20)

PDF
Write the following using javaGiven a class ‘Node’ and ‘NodeList’,.pdf
fathimalinks
 
PDF
Write a program in C++ that declares a structure to store the code n.pdf
fathimalinks
 
PDF
Write a generic VBA Sub procedure to compute the value of the follow.pdf
fathimalinks
 
PDF
Why are standards needed in data communication and networking What .pdf
fathimalinks
 
PDF
Which of the following are mismatched A. Giordia - transmitted by f.pdf
fathimalinks
 
PDF
Which of the following statements about human evolution is correct.pdf
fathimalinks
 
PDF
What are the six major pollutions in the National Ambient Air Qualit.pdf
fathimalinks
 
PDF
UPS Worldpart DiscussionWhat do you think are the operational str.pdf
fathimalinks
 
PDF
True or False Justify your answer.Using multilevel signaling, it .pdf
fathimalinks
 
PDF
This is question about excel cuers wish to answer shortly how to use.pdf
fathimalinks
 
PDF
There is a requirement to design a system to sense the presence of gl.pdf
fathimalinks
 
PDF
The investments of Charger Inc. include a single investment 11,010 .pdf
fathimalinks
 
PDF
RNA polymerasebinds to DNA after the double strands have been unwoun.pdf
fathimalinks
 
PDF
Research and explain the deviant actions of the Los Angeles Police D.pdf
fathimalinks
 
PDF
Question 1 10 points Save A TALIA Contribute NINA Co Contribute TALIA.pdf
fathimalinks
 
PDF
Q1. Print all the odd numbers from 1 to a user specifiable upper lim.pdf
fathimalinks
 
PDF
Please revise the answer bellow.Q1. What historically have been Ap.pdf
fathimalinks
 
PDF
Negligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdf
fathimalinks
 
PDF
List and explain at least three popular sixteenth century dance type.pdf
fathimalinks
 
PDF
Introduction to Database Management SystemConsider the following .pdf
fathimalinks
 
Write the following using javaGiven a class ‘Node’ and ‘NodeList’,.pdf
fathimalinks
 
Write a program in C++ that declares a structure to store the code n.pdf
fathimalinks
 
Write a generic VBA Sub procedure to compute the value of the follow.pdf
fathimalinks
 
Why are standards needed in data communication and networking What .pdf
fathimalinks
 
Which of the following are mismatched A. Giordia - transmitted by f.pdf
fathimalinks
 
Which of the following statements about human evolution is correct.pdf
fathimalinks
 
What are the six major pollutions in the National Ambient Air Qualit.pdf
fathimalinks
 
UPS Worldpart DiscussionWhat do you think are the operational str.pdf
fathimalinks
 
True or False Justify your answer.Using multilevel signaling, it .pdf
fathimalinks
 
This is question about excel cuers wish to answer shortly how to use.pdf
fathimalinks
 
There is a requirement to design a system to sense the presence of gl.pdf
fathimalinks
 
The investments of Charger Inc. include a single investment 11,010 .pdf
fathimalinks
 
RNA polymerasebinds to DNA after the double strands have been unwoun.pdf
fathimalinks
 
Research and explain the deviant actions of the Los Angeles Police D.pdf
fathimalinks
 
Question 1 10 points Save A TALIA Contribute NINA Co Contribute TALIA.pdf
fathimalinks
 
Q1. Print all the odd numbers from 1 to a user specifiable upper lim.pdf
fathimalinks
 
Please revise the answer bellow.Q1. What historically have been Ap.pdf
fathimalinks
 
Negligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdf
fathimalinks
 
List and explain at least three popular sixteenth century dance type.pdf
fathimalinks
 
Introduction to Database Management SystemConsider the following .pdf
fathimalinks
 
Ad

Recently uploaded (20)

PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PPTX
How to Define Translation to Custom Module And Add a new language in Odoo 18
Celine George
 
PPTX
HEAD INJURY IN CHILDREN: NURSING MANAGEMENGT.pptx
PRADEEP ABOTHU
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PDF
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
PDF
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
PDF
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
How to Define Translation to Custom Module And Add a new language in Odoo 18
Celine George
 
HEAD INJURY IN CHILDREN: NURSING MANAGEMENGT.pptx
PRADEEP ABOTHU
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
Ad

CODE#include stdlib.h #include stdio.hstruct task{proce.pdf

  • 1. CODE: #include #include struct task{//process int id;//pid int bt;//burst time int at;//arrival time int pr;//priority }; typedef struct task Task; typedef Task *TaskPtr; struct qnode{//a node in the run/ready queue Task data;//process struct qnode *nextPtr; }; typedef struct qnode Qnode; typedef Qnode *QnodePtr; void enqueue(QnodePtr *headPtr, QnodePtr *tailPtr,Task task); Task dequeue(QnodePtr *headPtr, QnodePtr *tailPtr); int isEmpty(QnodePtr headPtr); void enqueue(QnodePtr *headPtr, QnodePtr *tailPtr,Task task){ QnodePtr newNodePtr = malloc( sizeof( Qnode)); if(newNodePtr !=NULL){ newNodePtr->data = task; newNodePtr->nextPtr = NULL; } QnodePtr current = *headPtr, prev = NULL; while(current!=NULL && task.bt>=(current->data).bt){ prev = current; current = current->nextPtr; } if(prev==NULL){ newNodePtr->nextPtr= *headPtr; *headPtr=newNodePtr; }
  • 2. else{ newNodePtr->nextPtr=prev->nextPtr; prev->nextPtr=newNodePtr; } if(newNodePtr->nextPtr==NULL){ *tailPtr = newNodePtr; } } Task dequeue(QnodePtr *headPtr, QnodePtr *tailPtr){ Task value; QnodePtr tempPtr; value = (*headPtr)->data; tempPtr = *headPtr; *headPtr = (*headPtr)->nextPtr; if(*headPtr == NULL){ *tailPtr = NULL; } free (tempPtr); return value; } int isEmpty(QnodePtr headPtr){ return headPtr == NULL; } /////////////////////////////////////////////// struct event{//an event event int type;//event type 0:arrival, 1: departure int time;//event time Task task;//the process }; typedef struct event Event; typedef Event *EventPtr; struct eventQnode{//an node in the events list Event data;//the event struct eventQnode *nextPtr; }; typedef struct eventQnode EventQnode;
  • 3. typedef EventQnode *EventQnodePtr; void enqueueevent(EventQnodePtr *headPtr, EventQnodePtr *tailPtr,Event e); Event dequeueevent(EventQnodePtr *headPtr, EventQnodePtr *tailPtr); int isEmptyEQ(EventQnodePtr headPtr); void displayEvents(EventQnodePtr currentPtr); void enqueueevent(EventQnodePtr *headPtr, EventQnodePtr *tailPtr,Event se){ EventQnodePtr newNodePtr = malloc( sizeof( EventQnode)); if(newNodePtr !=NULL){ newNodePtr->data = se; newNodePtr->nextPtr = NULL; } EventQnodePtr current = *headPtr, prev = NULL; while(current!=NULL && se.time>(current->data).time){//find the insert position in order of time prev = current; current = current->nextPtr; } while(current!=NULL && se.time==(current->data).time && se.type<(current- >data).type){//then find the insert position in order of event's type prev = current; current = current->nextPtr; } if(prev==NULL){ newNodePtr->nextPtr= *headPtr; *headPtr=newNodePtr; } else{ newNodePtr->nextPtr=prev->nextPtr; prev->nextPtr=newNodePtr; } if(newNodePtr->nextPtr==NULL){ *tailPtr = newNodePtr; } } Event dequeueevent(EventQnodePtr *headPtr, EventQnodePtr *tailPtr){
  • 4. Event value; EventQnodePtr tempPtr; value = (*headPtr)->data; tempPtr = *headPtr; *headPtr = (*headPtr)->nextPtr; if(*headPtr == NULL){ *tailPtr = NULL; } free (tempPtr); return value; } int isEmptyEQ(EventQnodePtr headPtr){ return headPtr == NULL; } void displayEvents(EventQnodePtr currentPtr){ if(currentPtr==NULL) printf("The event list is empty ... "); else{ printf("The event list is: "); Event tempevent; while(currentPtr!=NULL){ printf(" time: %d, type : %d : task(id:%d,bt:%d) ", (currentPtr->data).time, (currentPtr->data).type, (currentPtr->data).task.at,(currentPtr- >data).task.bt); currentPtr=currentPtr->nextPtr; } } } /////////////////////////////////////////////// const int MAXTASKS = 10; const int MAXBURSTTIME = 70; const int IAT = 30; void main(){ QnodePtr rqheadPtr=NULL, rqtailPtr=NULL;//the run/ready queue EventQnodePtr eventsQheadPtr=NULL, eventsQtailPtr=NULL;//the event queue/list
  • 5. Task task;//the process structure Event event;//the event structure int prevat = 0, i;//set the previous arrival time to zero for(i=0;i Solution #include #include #include class cpuschedule { int n,bu[20]; float twt,awt,wt[20],tat[20]; public: void Getdata(); void fcfs(); void sjf(); void roundrobin(); }; //Getting no of processes and Burst time void cpuschedule::Getdata() { int i; cout<<“Enter the no of processes:”; cin>>n; for(i=1;i<=n;i++) { cout<<“ Enter The BurstTime for Process p”<>bu[i]; } } //First come First served Algorithm void cpuschedule::fcfs() { int i,b[10]; float sum=0.0;
  • 6. twt=0.0; for(i=1;i<=n;i++) { b[i]=bu[i]; cout<<“ Burst time for process p”<=1;i–) { for(j=2;j<=n;j++) { if(b[j-1]>b[j]) { temp=b[j-1]; b[j-1]=b[j]; b[j]=temp; } } } wt[1]=0; for(i=2;i<=n;i++) { wt[i]=b[i-1]+wt[i-1]; } for(i=1;i<=n;i++) { twt=twt+wt[i]; tat[i]=b[i]+wt[i]; sum+=tat[i]; } awt=twt/n; sum=sum/n; cout<<“ Total Waiting Time=”<>tq; //TO find the dimension of the Round robin array m=max/tq+1; //initializing Round robin array for(i=1;i<=n;i++) { for(j=1;j<=m;j++)
  • 7. { Rrobin[i][j]=0; } } //placing value in the Rrobin array i=1; while(i<=n) { j=1; while(b[i]>0) { if(b[i]>=tq) { b[i]=b[i]-tq; Rrobin[i][j]=tq; j++; } else { Rrobin[i][j]=b[i]; b[i]=0; j++; } } count[i]=j-1; i++; } cout<<“Display”; for(i=1;i<=n;i++) { for(j=1;j<=m;j++) { cout<<“ Rr[“<>ch; getch(); }while(ch<5); }