Write a program to select & print the largest of the three nos. using Nested-If-Else statement

#include <stdio.h> #include <conio.h> void main(){ float a, b, c; printf(“Enter three numbers: “); scanf(“%f %f %f”, &a, &b, &c); if (a>=b) { if(a>=c) printf(“Largest number = %.2f”,a); else printf(“Largest number = %.2f”,c); } else { if(b>=c) printf(“Largest number = %.2f”,b); else printf(“Largest number = %.2f”,c); } getch(); }

Write a program to solve Quadratic Equation

#include<stdio.h> #include<math.h> void main(){ float a,b,c; float d,root1,root2; printf(“Enter a, b and c of quadratic equation: “); scanf(“%f%f%f”,&a,&b,&c); d = b * b – 4 * a * c; if(d < 0){ printf(“Roots are complex number.\n”); printf(“Roots of quadratic equation are: “); printf(“%.3f%+.3fi”,-b/(2*a),sqrt(-d)/(2*a)); printf(“, %.3f%+.3fi”,-b/(2*a),-sqrt(-d)/(2*a)); return 0; } else if(d==0){ printf(“Both roots are equal.\n”); root1

Write a program that reads two nos. from key board and gives their addition, subtraction, multiplication, division and modulo.

#include<stdio.h> #include<conio.h> void main() { int a,b,sub,mul,div,add,mod; clrscr(); printf(“Enter the value of a&b”); scanf(“%d%d”,&a,&b); sub=a-b; mul=a*b; div=a/b; add=a+b; mod=a%b; printf(“sub of a&b is%d”,sub); printf(“mul of a&b is%d”,mul); printf(“div of a&b is%d”,div); printf(“add of a&b is%d”,add); printf(“Module of a&b is%d”,mod); getch(); }