This commit is contained in:
2026-09-24 14:50:31 +02:00
parent c53f50b3cd
commit 2302af30b5
18 changed files with 0 additions and 64 deletions
@@ -0,0 +1,18 @@
#include <stdio.h>
// Format Specifications - Practice
int main()
{
printf("We have %d coins in the bank\n", 100);
printf("We have %f coins in the bank\n", 125.7);
printf("Year = %d\n", 2020);
printf("Your average grade is: %f \n", 95.13);
printf("num1 = %d, num2 = %d, sum = %d \n", 5, 7, 5 + 7);
printf("num1 = %f, num2 = %f, sum = %f \n", 5.2, 7.3, 9.5);
printf("num1 = %d, num2 = %d, sub = %d \n", 5, 3, 5 - 3);
printf("a = %d, b = %d, sum = a + b = %d \n", 3, 5, 3 + 5);
printf("a = %d, b = %d, sum = %d + %d = %d \n", 3, 5, 3, 5, 3 + 5);
printf("a = %d, b = %d, sum = a + b = %d + %d = %d \n", 3, 5, 3, 5, 3 + 5);
return 0;
}
@@ -0,0 +1,17 @@
#include <stdio.h>
int main()
{
printf("%d + %d = %d \n", 5, 2, 5 + 2);
printf("%d - %d = %d \n", 5, 2, 5 - 2);
printf("%d * %d = %d \n", 5, 2, 5 * 2);
printf("%d / %d = %d \n", 5, 2, 5 / 2); // We take just the FULL part of the division
printf("%d %% %d = %d \n", 5, 2, 5 % 2); // Taking the remainder. Think about what would happen if you used just one "%".
return 0;
}
Binary file not shown.