answersLogoWhite

0

#include <stdio.h>

void main()

{

int num,num1,num2, cal;

num=cal=0;

char grade1=cal=0,grade2=cal=0;

printf("\n Enter the number of subjects taken in Spring Semester:");

scanf("%d", &num);

fflush(stdin);//

if(grade1==4){

printf("\n\nEnter the Math Grade(A,B,C): %c",grade1);

do{

printf("\ngrade1=");

scanf("%d",&cal);

}

else if(

printf("\nError!\n\n");

}while(1);

printf("\nEnter the Math Credit hours(1~3):");

num1 = getchar();

grade1=4;

}

else if(grade2==3){

grade2=3;

}

printf("\nEnter the Math Grade(A,B,C):\n");

scanf("%c",&grade1);

printf("Enter the Physics Grade(A,B,C):");

grade2 = getchar();

printf("\nEnter the Physics Credit hours(1~3):");

num2 = getchar();

printf("\nMath Credit hours: %d",num1);

printf("\nPhysics Grade: %c",grade2);

printf("\nPhysics Credit hours:%d\n",num2);

printf("\n <Math Credit hours> \n");

do{

printf("\n 1 + 1 = ");

scanf("%d", &cal);

}while(cal != 3);

printf("\n Error!\n\n");

}

printf("\n <Physics Credit hours> \n");

do{

printf("\n 4 - 1 = ");

scanf("%d", &cal);

}while(cal != 3);

printf("\n Error!\n");

}

printf("\n The End.\n");

system("pause");

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

C plus plus program using a stacks converting a postfix-infix?

Yes


Program to get a system time using c plus plus?

time in hours second minute


How can you program a TI-83 Plus to find area under a curve?

To program a TI-83 Plus to find the area under a curve, you can use the built-in integration functionality. Start by entering the function you want to integrate using the Y= menu. Then, create a new program by accessing the PRGM menu, selecting NEW, and entering your program name. In the program, use the fnInt command to calculate the integral, specifying the function, variable, lower limit, and upper limit. Finally, display the result using the Disp command.


C plus plus program calculate the power value of input base and exponent numbers?

cn = c0 *( 1 + i ) pow n


How do you calculate percentage of marks obtained in 1 subject in c plus plus?

You can't, you have to come up with variables to calculate grades


How do you write a program in C plus plus plus plus How do you write a program in C to swap two variables without using the third oneo swap two variables without using the third one?

To swap two variables without using a third variable, use exclusive or manipulation... a ^= b; b ^= a; a ^= b;


How do you write a C plus plus program that displays a pyramid of Xes on the screen using a for loop?

printf ("x")


Program to generate Fibonacci series using storage class in c plus plus?

i dn't know. haha


Any program in c plus plus without using any header file?

For example: int main (void) { return 0; }


How do you display stars in c plus plus using the if else structure and a for loop and you use void main?

It depends on what program you design really


What is the importance of functions in a c plus plus program?

Functions are very important in C++, as you can't write the simplest program to print hello without using a function. Overall you can say that function are building blocks of a C++ program. Functions can also be defined by the programmer to reduce program size.


What is the success rate of fourth graders using the Reading Plus program?

It is unfortunate the way American schools and their academic success is going these days. And, it is very sad to also say that among 4th grade pupils only 36 percent were successful using the Reading Plus program.