answersLogoWhite

0

How can you find CGPA for 6 Subject?

Updated: 8/19/2019
User Avatar

Ahmad006

Lvl 1
13y ago

Best Answer

#include<stdio.h>

#include<conio.h>

#define size 6

void cgpa(float gpa[],float chr[],int x);

void main ()

{

float gp[size];

int ch[size],i;

clrscr();

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

{

printf("Enter GP of %d th Subject: ",i+1);

scanf("%f",&gp[i]);

printf("Enter CH of %d th Subject: ",i+1);

scanf("%f",&ch[i]);

}

cgpa(gp,ch,6);

getch();

}

void cgpa(float gpa[],float chr[],int x)

{

float ch_t=0,gp_t=0,cgpa,mul;

int i;

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

{

ch_t=ch_t+chr[i];

gp_t=gp_t+gpa[i];

}

mul=ch_t*gp_t;

cgpa=gp_t/x;

printf("CGPA of %d Subjects is %.3f",x,cgpa);

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you find CGPA for 6 Subject?
Write your answer...
Submit
Still have questions?
magnify glass
imp