सूचना सहायक C – Language कन्फ्यूजिंग प्रश्न सम्पूर्ण हल

नीचे दिए गए प्रोग्राम का हल क्या होगा क्या परिणाम प्राप्त होगा।

Main()
{
int a=5,b=7;
if(a=b)
printf("Gud Eve");
else
Printf("Gud mrng");
}

 

परिणाम 1

warning: return type defaults to ‘int’ [-Wimplicit-int] Main()
^~
prog.c: In function ‘Main’:
prog.c:4:1: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(a=b)
^~
prog.c:5:1: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] printf(“Gud Eve”);
^~~~
prog.c:5:1: warning: incompatible implicit declaration of built-in function ‘printf’
prog.c:5:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
prog.c:7:1: warning: implicit declaration of function ‘Printf’ [-Wimplicit-function-declaration] Printf(“Gud mrng”);
^~~~
prog.c:8:1: warning: control reaches end of non-void function [-Wreturn-type] }
^
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start’:
(.text+0x20): undefined reference to `main’
collect2: error: ld returned 1 exit status

परिणाम – 2

prog.c: In function ‘Main’:
prog.c:6:1: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(a=b)
^~
prog.c:9:1: warning: implicit declaration of function ‘Printf’ [-Wimplicit-function-declaration] Printf(“Gud mrng”);
^~~~
prog.c:10:1: warning: control reaches end of non-void function [-Wreturn-type] }
^
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start’:
(.text+0x20): undefined reference to `main’
collect2: error: ld returned 1 exit status

error: Content is protected !!
/* ]]> */