0
Pls some one help me to run this program i try but wouldn't
include<stdio.h> #include<conio.h> void main(void) { //*program that can calculate cgpa of two smesters float gpa1,gpa2,cgpa; clrscr(); printf("Enter your first gpa="); scanf("%f",&gpa1); printf("\nEnter your 2nd gpa="); scanf("%f",&gpa2); cgpa=(gpa1+gpa2)/2; printf("\nYour CGPA is %f",cgpa); getch(); }
4 Respuestas
+ 8
Usman Suleiman Jibrin getch(), clrscr() is conio.h library functions which are only supported in old compiler like TurboC++ which should not be used as there are many modern compiler are present.
#include<stdio.h>
int main(void)
{
//*program that can calculate cgpa of two smesters
float gpa1,gpa2,cgpa;
printf("Enter your first gpa=");
scanf("%f",&gpa1);
printf("\nEnter your 2nd gpa=");
scanf("%f",&gpa2);
cgpa=(gpa1+gpa2)/2;
printf("\nYour CGPA is %f",cgpa);
}
0
include<stdio.h>
#include<conio.h>
void main(void)
{
//*program that can calculate cgpa of two smesters
float gpa1,gpa2,cgpa;
clrscr();
printf("Enter your first gpa=");
scanf("%f",&gpa1);
printf("\nEnter your 2nd gpa=");
scanf("%f",&gpa2);
cgpa=(gpa1+gpa2)/2;
printf("\nYour CGPA is %f",cgpa);
getch();
}