Professional Documents
Culture Documents
#include <stdio.h>
int main()
{
int number;
printf("Enter a Number\n");
scanf("%d", &number);
if(number > 0)
printf("%d is Positive Number", number);
else if (number < 0)
printf("%d is Negative Number", number);
else
printf("Input Number is Zero");
return 0;
}
#include<stdio.h>
#include<conio.h>
int main()
{
int a, b, c;
printf("Enter three numbers");
scanf("%d%d%d", &a, &b, &c);
if((a<b)&&(b<c))
printf("%d is minimum",a);
else if(a<c)
printf("%d is minimum",b);
else
printf("%d is minimum",c);
getch();
return 0;
}
#include <stdio.h>
#include <math.h>
void main()
{
int a,b,c,d;
float x1,x2;
if(d>0)
printf("Both roots are real and diff-2\n");
x1=(-b+sqrt(d))/(2*a);
x2=(-b-sqrt(d))/(2*a);
printf("First Root Root1= %f\n",x1);
printf("Second Root root2= %f\n",x2);
else if(d=0)
printf("Both roots are equal.\n");
x1=-b/(2.0*a);
x2=x1;
printf("First Root Root1= %f\n",x1);
printf("Second Root Root2= %f\n",x2);
else
printf("Root are imeainary");
return 0;
}