Skip to content

Instantly share code, notes, and snippets.

@not7cd
Created February 28, 2018 15:40
Show Gist options
  • Save not7cd/7493167de91d23cbfa01457dc7e58269 to your computer and use it in GitHub Desktop.
Save not7cd/7493167de91d23cbfa01457dc7e58269 to your computer and use it in GitHub Desktop.
Proceduralne Języki Programowania I
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a, b, c, d, sum;
float avr;
printf("Give first number: ");
scanf("%i", &a);
printf("Give second number: ");
scanf("%i", &b);
printf("Give third number: ");
scanf("%i", &c);
printf("Give fourth number: ");
scanf("%i", &d);
sum = a+b+c+d;
printf("Sum of your numbers: %i\n", sum);
avr = (float) sum / 4;
printf("Average of your number: %f\n", avr);
int ans = (2.f + 2.f) == (int) 4;
int ans2 = 2 + 2 == 4;
printf("%i vs %i", ans, ans2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment