> mark list program in c ~ Online tutorial

mark list program in c


The following program get Marks Card Details and shows Min and Max marks as the output.

#include<stdio.h>
#include<conio.h>

struct markscard {
                                        int rollno;
                                        int marks;
                                        char name[35];
                                        char addres[35];
                                 } ;

void main()
{
 struct markscard mcrd[10];
 int i, maxm, mimm;

 clrscr();
 for(i=1;i<=10;i++)
 {
        printf("n%d Roll Number : ",i);
        scanf("%d", &mcrd[i].rollno);
        printf("  Name        : ");
        fflush(stdin);
        gets(mcrd[i].name);
        printf("  Address     : ");
        fflush(stdin);
        gets(mcrd[i].addres);
        printf("  Marks       : ");
        scanf("%d", &mcrd[i].marks);
 }

 clrscr();
 printf("nThe Data you entered are :");
 printf("n#  Roll#tNametAddresstMarks");

 maxm = 0;
 mimm = mcrd[1].marks;

 for(i=1;i<=10;i++)
 {
        printf("n%d  %dt%-20st%-20st%d",i,mcrd[i].rollno,mcrd[i].name,mcrd[i].addres,mcrd[i].marks);
        if (mcrd[i].marks >= maxm)
        maxm = mcrd[i].marks;
        if (mcrd[i].marks <= mimm)
        mimm = mcrd[i].marks;
 }

 printf("nnHighest Marks : %d",maxm);
 printf("nLowest Marks  : %d",mimm);
 getch();
}
 

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: