SGPA(Semester Grade Performance Average) and CGPA(Cumulative Grade Performance average Point)depends on how you score in exams. suppose in first semester have a 6 subjects and each subject has a 5 credits for example on semester 1 you score a marks like this
Subject 1 Grade D
Subject 2 Grade D
Subject 3 Grade C
subject 4 Grade C
Subject 5 Grade A
Subject 6 Grade O
here the Grade point and marks are calculated according to this(Sauarastra University)
your total earned Grade Point is C+E+D+D+C+O= 225 Grade Point Calculated like this (Earned Grade in Subject * Credit of Subject= Subject Grade Point)
6*5 = 30
6*5 = 30
7*5 = 35
7*5 = 35
9*5 = 45
10*5=50
So your total sum of Grade Point is 225. after that you need to multiply the total Grade Point with Total credit of all Subject in this example total subject is 6 so Credit total is (5+5+5+5+5+5)=30
Total Grade Point / Total Credits = 225/30 = 7.50 This is your SGPA
And for CGPA is all over average of your degree so in this example your 1st semester SGPA is also 7.50 for better understand lets calculate 2nd semester SGPA and CGPA
Suppose in 2nd semester you earned 195 Grade Point so your total SGPA in this semester is 195/30= 6.50 SGPA and for CGPA you need to add previous semester Grade point into this sem ester so your total Grade Point is 225+195=420 and also add the previous credits into this semester credit 30+30=60
After that same process 420/60 =7.00
I hope this is helpful Thanks