additional files
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
//Made by Vlad. Budnitski.
|
||||
//AlphaTech - Programming Course.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int grade;
|
||||
scanf("%d", &grade);
|
||||
if (grade >= 60)
|
||||
printf("Congratulations! \n");
|
||||
else
|
||||
printf("Failed.. Try again \n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//Made by Vlad. Budnitski.
|
||||
//AlphaTech - Programming Course.
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Finding if a given number is EVEN or ODD */
|
||||
int main()
|
||||
{
|
||||
int num;
|
||||
printf("Enter a number: ");
|
||||
scanf("%d", &num);
|
||||
if (num % 2 == 0)
|
||||
printf("%d is an EVEN number \n", num);
|
||||
else
|
||||
printf("%d is an ODD number \n", num);
|
||||
//if (num % 2 != 0)
|
||||
// printf("%d is an ODD number \n", num);
|
||||
//else
|
||||
// printf("%d is an EVEN number \n", num);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
//Made by Vlad. Budnitski.
|
||||
//AlphaTech - Programming Course.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a, b, c;
|
||||
int max, min;
|
||||
printf("Enter first number: ");
|
||||
scanf("%d", &a);
|
||||
printf("Enter second number: ");
|
||||
scanf("%d", &b);
|
||||
printf("Enter third number: ");
|
||||
scanf("%d", &c);
|
||||
max = a;
|
||||
min = b;
|
||||
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,21 @@
|
||||
//Made by Vlad. Budnitski.
|
||||
//AlphaTech - Programming Course.
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int grade; // Declaration
|
||||
|
||||
printf("Enter your grade: ");
|
||||
scanf("%d", &grade); // Getting input from user
|
||||
|
||||
if(grade>80) // If grade is above 80
|
||||
printf("Excellent Job!\n");
|
||||
else if(grade>60) // If grade is not above 80 but still above 60
|
||||
printf("Not bad...Study more next time.\n");
|
||||
else // If grade is less than 60 (or equals to 60)
|
||||
printf("Oh.. You didn't pass..\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
//Made by Vlad. Budnitski.
|
||||
//AlphaTech - Programming Course.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// NOTE: This program is for explanatory purposes only.
|
||||
// It shouldn't run yet!
|
||||
|
||||
int main()
|
||||
{
|
||||
// Logical Operators //
|
||||
// If we got 90 or higher
|
||||
// AND
|
||||
// If we have less than 50 bucks
|
||||
int money;
|
||||
int grade;
|
||||
printf("Enter money and grade: \n");
|
||||
scanf("%d%d", &money, &grade);
|
||||
|
||||
if (money < 50 && grade > 90)
|
||||
// Do something
|
||||
|
||||
if (money < 50 || grade > 90)
|
||||
// Do something
|
||||
|
||||
// NOT <-> "!"
|
||||
if (!(grade > 80))
|
||||
printf("Good Job! \n"); // grde<-80
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
//Made by Vlad. Budnitski.
|
||||
//AlphaTech - Programming Course.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
float x1, y1, x2, y2;
|
||||
float distance;
|
||||
printf("Enter X1: ");
|
||||
scanf("%f", &x1);
|
||||
printf("Enter Yl: ");
|
||||
scanf("%f", &y1);
|
||||
printf("Enter X2: ");
|
||||
scanf("%f", &x2);
|
||||
printf("Enter Y2: ");
|
||||
scanf("%f", &y2);
|
||||
distance = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
|
||||
printf("The distance between the points (%.2f, %.2f) and (%.2f, %.2f) is %.2f\n", x1, y1, x2, y2, distance);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user