#include <stdio.h> #include <math.h> void main() { float a,b,c,d,temp,r1,r2; printf("\nEnter the value of a\t:"); scanf("%f",&a); printf("Enter the value of b\t:"); scanf("%f",&b); printf("Enter the value of c\t:"); scanf("%f",&c);
d=((b*b)-(4*c*a));
if(d==0) { printf("\nRoots are real and equal\n"); r1=-b/(2*a); printf("\t X1=%f \n \t X2=%f ", r1, r1 ); }
else if(d>0) { printf("\nRoots are real and distinct\n"); temp=sqrt(d);
#include<stdio.h> void main() { int a[5][5],b[5][5],c[5][5]; int i,j; for(i=0;i<5;i++) { printf("\nEnter elements of %d row of first Matrix: ",i+1); for(j=0;j<5;j++) scanf("%d",&a[i][j]); } for(i=0;i<5;i++) { printf("\nEnter elements of %d row of second Matrix: ",i+1); for(j=0;j<5;j++) scanf("%d",&b[i][j]); } printf("\nSum of Matrix:\n\n"); for(i=0;i<5;i++) { for(j=0;j<5;j++) { c[i][j]=a[i][j]+b[i][j]; printf("%3d ",c[i][j]); } printf("\n"); } }
Comments
Post a Comment