1. Write a Program to accept rollnumber and mark of three subject from user and print total marks, average and grade in C language Program . 
2. Write a Program to find the roots of a quadratic equation in C language Program.

1. 

Write a Program to accept rollnumber and mark of three subject from user and print total marks, average and grade in C language - Program Code

Program Code :-

/* Write a Program to accept rollnumber and mark of three subject from user and print total marks, average and grade */
   #include<stdio.h>
   #include<conio.h>
   void main()
   {
     int rollnum ,m1,m2,m3,total;
     float avg;
     clrscr();
     printf("Enter Rollnumber = ");
     scanf("%d",&rollnum);
     printf("Enter mark of three subject : ");
     scanf("%d %d %d",&m1,&m2,&m3);
     total=m1+m2+m3;
     printf("Total mark of three subject = %d\n",total);
     avg = total/3.0;
     printf("Average = %f\n",avg);
     if(avg>=80 && avg <=100)
     {
       printf("Grade = A");
     }
     else if(avg>=60 && avg<80)
     {
       printf("Grade = B");
     }
     else if(avg>=40 && avg<60)
     {
       printf("Grade = C");
     }
     else if(avg>=33 && avg<40)
     {
       printf("Grade = D");
     }
     else if(avg>=0 && avg<33)
     {
       printf("Your fail");
     }
     else
     {
       printf("Please Enter correct Mark");
     }
     getch();
   }

Take mark of three subject print total marks, average and grade in C Language program - Program Code

Take mark of three subject print total marks, average and grade in C Program - Program Code

Take mark of three subject print total marks, average and grade C Program output - Program Code

Take mark of three subject print total marks, average and grade C Program output - Program Code


Program Code Download :- 
Download Program to Click Here....

2. 

Write a Program to find the roots of a quadratic equation in C language - Program Code

Program Code :-

/* Write a Program to find the roots of a quadratic equation   */
   #include<stdio.h>
   #include<conio.h>
   #include<math.h>
   void main()
   {
      float a,b,c,discriminant,real;
      double r1,r2,imag;
      clrscr();
      printf("Enter coefficients a,b and c :");
      scanf("%f %f %f",&a,&b,&c);
      discriminant = b*b-(4*a*c);
      if(discriminant>0)
      {
r1 = (-b+sqrt(discriminant))/(2*a);
r2 = (-b-sqrt(discriminant))/(2*a);
printf("Roots are : %.2f and %.2f",r1,r2);
      }
      else if(discriminant == 0)
      {
r1 = r2 = -b/(2*a);
printf("Roots are : %.2f and %.2f",r1,r2);
      }
      else
      {
real = -b/(2*a);
imag = sqrt(-discriminant)/(2*a);
printf("Roots are %.2f+%.2fi and %.2f-%.2fi",real,imag,real,imag);
      }
      getch();
   }       


Roots of a quadratic equation C Program - Program Code

Roots of a quadratic equation C Program - Program Code

Roots of a quadratic equation C Program output - Program Code

Roots of a quadratic equation C Program output - Program Code

Program Code Download :- 
Download Program to Click Here....