array i/o +loop

 #include <stdio.h>


int main() {

    

    int n ;

    printf("No. of students are : ");

    scanf("%d", &n);

    int marks[n];

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

        printf (" Enter marks of student %d : ", i +1);

        scanf("%d", &marks[i]);

        

    }

    

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

    printf(" Student %d got %d  marks \n" , i +1, marks[i]) ;

   }

    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings