strange output in c program
rahul deshmukh
rahul.dshmkh1 at gmail.com
Wed Jul 8 11:34:46 UTC 2020
Hi Team,
i was learning c programming and came across a very strange output. kindly
someone please guide me if i am missing anything.
rdx at FreeBSD:~/Projects/Clang/chapter3 % uname -a
FreeBSD FreeBSD 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64
========================================================================
rdx at FreeBSD:~/Projects/Clang/chapter3 % cat example6.c
#include <stdio.h>
int main()
{
int a = 300, b, c;
if(a >= 400)
{
printf("shouldn't print\n");
b = 300;
}
c=200;
printf("%d %d\n", b, c);
return 0;
}
=========================================================
rdx at FreeBSD:~/Projects/Clang/chapter3 % make example6
`example6' is up to date.
rdx at FreeBSD:~/Projects/Clang/chapter3 % ./example6
300 200==> should be garbage value instead of 300?
--
Thank you
---------------------
Rahul Deshmukh
More information about the freebsd-hackers
mailing list