Programme to generate a new array using multiple arrays

Programme to generate a new array using multiple arrays
This is a C++ program which will take input of multiple arrays and will get sum up to generate a new array. We have also under taken few basic commands such as "gotoxoy" to arrange the output. The header files used in this are "iostream.h","conio.h","stdio.h","process.h". These are few basic commands whose perfect use can be learnt by a C++ student while viewing this post. This program can enhance ones knowledge related to process.h header file as it is not used more frequently. The proram is as follows:

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
struct student
{
char name[30];
int roll;
int mark1;
int mark2;
int mark3;
int total;
}st[100];
main()
{
int n,ch,i,j;
char choice;
do
{
clrscr();
cout << "1. For enter "<<endl;
cout << "2. For tabular report"<<endl;
cout << "3. For Report card"<<endl;
cout << "4. For exit";
cin >> ch;
switch(ch)
{
case 1: cout << "Enter how many students ";
cin >>n;
for(i=0;i<n;i++)
{
cout << "Enter name ";
gets(st[i].name);
cout << "Enter Roll Number ";
cin >>st[i].roll;
cout << "Enter Mark1 ";
cin >>st[i].mark1;
cout << "Enter Mark2 ";
cin >> st[i].mark2;
cout << "Enter Mark3 ";
cin >> st[i].mark3;
st[i].total = st[i].mark1+st[i].mark2+st[i].mark3;
}

break;
case 2:
student temp;
for (i=0;i<n;i++)
{
for(j=i;j<n-1;j++)
{
if (st[j].total>st[j+1].total)
{
temp = st[j];
st[j]=st[j+1];
st[j+1]=temp;
}
}
}
gotoxy(6,6);
cout <<"Name ";
gotoxy(16,6);
cout <<"Roll";
gotoxy(26,6);
cout <<"Mark1";
gotoxy(36,6);
cout <<"Mark2";
gotoxy(46,6);
cout <<"Mark3";
gotoxy(56,6);
cout <<"Total";
int r = 8;
for(i=0;i<n;i++)
{
gotoxy(6,r);
cout <<st[i].name;
gotoxy(16,r);
cout <<st[i].roll;
gotoxy(26,r);
cout <<st[i].mark1;
gotoxy(36,r);
cout <<st[i].mark2;
gotoxy(46,r);
cout <<st[i].mark3;
gotoxy(56,r);
cout <<st[i].total;
r++;
}

break;
case 3: int troll;
cout << "\nEnter the roll number to be searched ";
cin >> troll;
for(i=0;i<n;i++)
{
if (st[i].roll == troll)
{
cout << " \n Name "<<st[i].name;
cout << "\n Roll "<< st[i].roll;
cout << "\n Mark1 "<<st[i].mark1;
cout << "\n Mark2 "<<st[i].mark2;
cout << "\n Mark3 "<<st[i].mark3;
cout << "\n total "<<st[i].total;
}
}
break;
case 4: exit(0);

}
cout << "\n Do U want to continue";
cin>>choice;
}while(choice == 'Y' ||choice =='y');
}

C++ Program to generate report card of a student as per entry of marks

C++ Program to generate report card of a student as per entry of marks
This C++ based program basically will take enrty of a students name, roll number and his/her marks in atleast 3 subjects and generate a report card of that students performance. This program has been desinged using arrays. This program undertakes multiple cases so switch cases has been used to simplify it. This program has also undertaken the concept of strings with the header file <string.h> this will help in enhancing a students mind that how well can three arrays be used to generate a new array. The program is as follows:
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>

void main()
{
clrscr();
char *name[50],*nm;
int rno[50],m1[50],m2[50],m3[50],tot[50],i,n,trn;
cout<<"Enter no. of records: ";
cin>>n;
for(i=0;i<n;i++)
{
cout<<"Enter Name of Student "<<i<<": ";
gets(name[i]);
cout<<"Enter Roll No. of Student "<<i<<": ";
cin>>rno[i];
cout<<"Enter Mark1 of Student "<<i<<": ";
cin>>(m1[i]);
cout<<"Enter Mark2 of Student "<<i<<": ";
cin>>(m2[i]);
cout<<"Enter Mark3 of Student "<<i<<": ";
cin>>(m3[i]);
tot[i]=m1[i]+m2[i]+m3[i];
}
char ch,ch1;
int flag=0;
cout<<"\n\t1.Report card for particular student"
"\n\t2.List all records\n\t3.Exit";
cin>>ch;
do
{
switch(ch)
{
case '1':
cout<<"\nEnter the Roll no.";
cin>>trn;
flag=0;
for(i=0;i<n;i++)
if(trn==rno[i])
{
cout<<"\n Name: "<<name[i]<<"\t";
cout<<"Roll No.: "<<rno[i];
cout<<"\nMark1: "<<m1[i];
cout<<"\nMark2: "<<m2[i];
cout<<"\nMark3: "<<m3[i];
cout<<"\n----------";
cout<<"\nTotal: "<<tot[i];
flag=1;

}
if(flag==0)
cout<<"Record not found";
break;
case '2':
cout<<"\nRollno\tName     \tMark1\tMark2\tMark3";
cout<<"\tTotal";
cout<<"\n------\t----------\t----\t----\t----";
cout<<"\t-----";
for(i=0;i<n;i++)
{
cout<<"\n"<<rno[i]<<"\t"<<name[i]<<"\t"
<<m1[i]<<"\t"<<m2[i]<<"\t"<<m3[i]<<"\t"
<<tot[i];
}
break;
}
cout<<"\n\t1.Report card for particular student"
"\n\t2.List all records\n\t3.Exit";
cin>>ch;


}while(ch!='3');
getch();
}