C programming
Critical equation: (Uses of if else)
#include<conio.h>
#include<stdio.h>
#include<math.h>
void main()
{
clrscr();
int a,x,b,c,ans;
printf("enter to
select(serial=a,b,c)");
scanf("%d %d
%d",&a,&b,&c);
ans=(a*x*x)+(b*x)+c ;
if ((b*b)-(4*a*c)==0)
{printf("Real and equal");}
if((b*b)-(4*a*c)>0)
{printf("Real and non equal");}
if ((b*b)-(4*a*c)<0)
{printf("Critical and non real");}
getch();
}
No comments:
Post a Comment
Please comment bellow. Share your knowledge