reachable and unreachable code

This commit is contained in:
Mert Gör 🇹🇷 2024-10-30 04:18:34 +03:00
parent 3f8ba5ba80
commit 3b7caa231a
Signed by: hwpplayer1
GPG Key ID: 03E547D043AB6C8F
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2024-10-30 Mert Gör <mertgor@masscollabs.xyz>
* c-basic/return_not_reachable.c (main): reachable code and unreachable code return
2024-10-29 Mert Gör <mertgor@masscollabs.xyz>
* c-basic/C.pdf: return value page 22

View File

@ -0,0 +1,16 @@
#include <stdio.h>
int foo()
{
printf("I am foo\n");
return 100;
printf("I am test\n"); // unreachable code
}
int main()
{
int result;
result = foo() * 2;
printf("result = %d\n", result);
}