Computer Science, asked by asimkadapa, 8 months ago

NEED ANSWER FAST- c++ programme to accept 3 students marks and find their average

Answers

Answered by shirishanaidu499
2

Answer:

Explanation:

#include<iostream.h>

#include<conio.h>

void main ( )

{  

           struct student

        {

             int subject1 ;

             int subject2 ;

             int subject3 ;

        };

              int i , n, total;

              float av ;

              clrscr();

              struct student st[20];

              cout<<" \n Enter the Number of Students : " ;

              cin>> n ;

              for (i =0; i<n; i++)

                  {

                         cout<<"\nEnter Marks of three Subjects of "<<i+1<<" Student : " ;

                         total = 0 ;

                         cin>> st[i].subject1 >>st[i].subject2>>st[i].subject3;

                         total = st[i].subject1+st[i].subject2+st[i].subject3;

                         av = (float) total /3 ;

                         cout<<"\nAVERAGE Marks of " <<i+1<<" Student is = "<< av ;

                   }

                         getch( );

Similar questions