update stage
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Find the MIN MAX value of three values */
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
int a, b, c;
|
||||
|
||||
int max, min;
|
||||
|
||||
printf("Enter first nubmer: ");
|
||||
scanf("%d", &a);
|
||||
printf("Enter second nubmer: ");
|
||||
scanf("%d", &b);
|
||||
printf("Enter third nubmer: ");
|
||||
scanf("%d", &c);
|
||||
|
||||
if (a < b)
|
||||
{
|
||||
max = b;
|
||||
min = a;
|
||||
}
|
||||
|
||||
if (max < c)
|
||||
max = c;
|
||||
|
||||
if (c < min)
|
||||
min = c;
|
||||
|
||||
printf("MAXIMUM between 3 numbers = %d\n", max);
|
||||
printf("MINIMUM between 3 numbers = %d\n", min);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a, b, c;
|
||||
|
||||
printf("Pleas enter 3 values: \n");
|
||||
|
||||
scanf("%d %d %d", &a, &b, &c);
|
||||
|
||||
printf("a = %d b = %d c = %d\n", a, b, c);
|
||||
|
||||
if (a < b && a < c)
|
||||
{
|
||||
printf("a = %d -> Minimum\n", a);
|
||||
}
|
||||
|
||||
if (b < a && b < c)
|
||||
{
|
||||
printf("b = %d -> Minimum\n", b);
|
||||
}
|
||||
|
||||
if (c < a && c < b)
|
||||
{
|
||||
printf("c = %d -> Minimum\n", c);
|
||||
}
|
||||
|
||||
if (a > b && a > c)
|
||||
{
|
||||
printf("a = %d -> Maximum\n", a);
|
||||
}
|
||||
|
||||
if (b > a && b > c)
|
||||
{
|
||||
printf("b = %d -> Maximum\n", b);
|
||||
}
|
||||
|
||||
if (c > a && c > b)
|
||||
{
|
||||
printf("c = %d -> Maxmum\n", c);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//Made by Vlad. Budnitski.
|
||||
//AlphaTech - Programming Course.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
/* Finding MAX and MIN between 2 numbers */
|
||||
int main()
|
||||
{
|
||||
float numl, num2;
|
||||
printf("Enter num1: ");
|
||||
scanf("%f", &numl);
|
||||
printf("Enter num2: ");
|
||||
scanf("%f", &num2);
|
||||
if (numl > num2)
|
||||
{
|
||||
printf("MAXIMUM = %f \n", numl);
|
||||
printf("MINIMUM = %f \n", num2);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("MAXIMUM = %f \n", num2);
|
||||
printf("MINIMUM = %f \n", numl);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user