Работы по программированию

This commit is contained in:
IgorVolochay
2026-07-28 09:56:54 +03:00
parent b85155ff95
commit 8602b7e845
73 changed files with 4090 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
/*
4.Даны целочисленные переменные А и В. Задать их значения с клавиатуры. Поменять значения в переменных А и В без дополнительных переменных.
*/
#include <stdio.h>
void swap(int *a, int *b) {
*a += *b;
*b = *a - *b;
*a -= *b;
}
int main() {
int a, b;
printf("Enter 2 digits: ");
scanf("%d %d", &a, &b);
swap(&a, &b);
printf("%d %d", a ,b);
return 0;
}