Monday, 18 May 2015

Write a Program in c++to input the marks of five students in an array and then print all the marks.

Coding:- 

  #include<iostream.h>
void main()
{
 int marks[5] ;
int i;


 cout<<"enter marks of five students ";

 for(i=0;i<=4;i++)
 {
cin>>marks[i];
 }


cout<<"the marks of students are: \n";

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

 cout<<"marks of " << i+1<<"student is :" << marks[i]<<endl;


}

Output:- 

                       

No comments:

Post a Comment