From 8d26918b7f4f4c97dafd3342a75fdb1c7611b9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Wed, 24 Jan 2024 15:47:29 +0300 Subject: [PATCH] two variables scanned by scanf --- c-basic/scanf-example-two-variables.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 c-basic/scanf-example-two-variables.c diff --git a/c-basic/scanf-example-two-variables.c b/c-basic/scanf-example-two-variables.c new file mode 100644 index 0000000..437ee84 --- /dev/null +++ b/c-basic/scanf-example-two-variables.c @@ -0,0 +1,23 @@ +/** + * @file scanf-example-two-variables.c + * @author Mert Gör (mertgor@masscollabs.xyz) + * @brief scanf example with two variables + * @version 0.1 + * @date 2024-01-24 + * + * @copyright Copyright (c) 2024 Mert Gör and contributors - GPLv3 or any later + * + */ + +#include + +int main(){ + int a; + int b; + + printf("enter two variables/numbers: "); + scanf("%d%d", &a, &b); + printf("a = %d, b = %d\n", a, b); + + return 0; +} \ No newline at end of file