WAP TO READ THE MARKS OF 5 STUDENTS UNDER AN ARRAY

 

#include<iostream.h>
#include<conio.h>
Void main()
{
     int marks[5],i,j,total=0;
     for(i=0;i<5;i++)
     {
           cout<<”Enter”<<i+1<<”subject marks:”;
           cin>>marks[i];
     }
     for(j=0;j<5;j++)
     {
          total=total+marks[j];
     }
     cout<<”Total marks is:”<<total;
     getch();

 }

Comments

Popular Posts