Sunday 1 January 2017

Program to Read marks of 50 Students and store them under an array.

Share & Comment
CODE

#include <iostream.h>

#include <stdlib.h>

Int main ()

{              system (“CLS”) ;

                Float marks [50] ;

                For ( int I = 0 ; I < 50 ; ++ I ; ) ;

{              cout <<” Enter the marks of students “<< I + 1 << “ : “ ;

                Cin >> makrs[ I ] ;

}

                Cout <<”\n” ;

                For ( I = 0 ; I < 50 ; ++ I )

                Cout <<” Marks [“<< I <<” ] = “ << marks[ I ] << “\n” ;

Return 0 ;


Tags:

Written by

Hy, i am a Code Geek ! And like to eduate others.

2 comments:

  1. your code had so many mistakes and i edit that. here is executable cod :

    #include
    #include

    int main ()
    {
    int marks[50];

    for (int i=0; i<50; ++i)
    {
    std::cout << "Enter the marks of students #"<< i + 1 << ":";
    std::cin >> marks[i];
    std::cin.ignore(32767, '\n');
    }

    std::cout <<"\n";

    for (int i=0; i<50; ++i)
    std::cout <<"Marks ["<< i <<"] = " << marks[i] << "\n";

    return 0 ;
    }

    ReplyDelete
  2. may need validating prior to storing it no?
    how to catch errors and display them (say if one mark is being misstyped or missing info in the file)

    ReplyDelete

 
Copyright © C++ Programming | Designed by Templateism.com