Wap in C to find the percentage of a students marks.
#include<stdio.h>
#include<conio.h> void main(void) { clrscr(); int i,j,marks[5][6],count; char ch; float perc; for(i=0;i<5;i++) { printf("Enter record of student # %d",i+1); for(j=0;j<6;j++) { printf("Enter marks of student # %d",j+1); scanf("%d",&marks[i][j]); } } printf("Do You Want To Conti.... (y/n) "); ch=getche(); if(ch=='n'||ch=='N') count=i; break; int sum[count]; for(i=0;i<count;i++) { sum[i]=0; for(j=0;j<6;j++) sum[i]=sum[i]+marks[i][j]; perc=(sum[i]*100)/6; printf("percentage of student # %d is %2f %",i+1,perc); } getch(); } |