Explain output
1) #include<stdio.h>
extern int i;
main()
{
printf("%d",i);
}
2) #include<stdio.h>
extern int i=100;
main()
{
printf("%d",i);
}
help with homework
Started by rajan, Mar 24 2010 04:38 AM
7 replies to this topic
#1
Posted 24 March 2010 - 04:38 AM
|
|
|
#2
Posted 24 March 2010 - 07:33 AM
Are you trying to figure out what they do, or something else?
#3
Posted 24 March 2010 - 09:17 AM
LOL ummm run it through a compiler and see.
while(1) { if(if_girl_is_pretty(girl)) ask_her_out();
else drink_another_beer(); }
else drink_another_beer(); }
#4
Posted 24 March 2010 - 09:40 AM
My interpretation of this BAD topic is that you have to do the following:
What is the output in the first snippet and why?
What is the output in the second snippet and why?
To find that out you have to do a dreadful thing! You have to READ! your course book.
It's the most dreaded thing in your life apparently. This is a SIMPLE homework if you cant find this out yourself you should quit the course. Because you wont make it if you cannot read your course book or listen to your teacher when he say:
"If you use a variable without giving it a value this will happen: [---]" explanation is in the bold part here.
So now you open your book and read the first and second chapter in the book and you will understand why the output is this way.
Oh and read this: http://forum.codecal...r-homework.html
Good luck!
What is the output in the first snippet and why?
What is the output in the second snippet and why?
To find that out you have to do a dreadful thing! You have to READ! your course book.
It's the most dreaded thing in your life apparently. This is a SIMPLE homework if you cant find this out yourself you should quit the course. Because you wont make it if you cannot read your course book or listen to your teacher when he say:
"If you use a variable without giving it a value this will happen: [---]" explanation is in the bold part here.
So now you open your book and read the first and second chapter in the book and you will understand why the output is this way.
Oh and read this: http://forum.codecal...r-homework.html
Good luck!
Edited by FrozenSnake, 24 March 2010 - 01:17 PM.
change valuble to variable :P
#5
Posted 24 March 2010 - 01:05 PM
Analyze this code snippet.
While( !User.hasAnswer )
{
User.askQuestion();
if( User.postCode && User.putForthEffort )
{
CodeCallMembers.Help();
User.hasAnswer = true;
}
else
{
CodeCallMembers.Laugh();
}
}
-CDG10620
Software Developer
Software Developer
#6
Posted 25 March 2010 - 12:37 PM
@CDG10620: every time I see your snippet I have to lol...
^_^
^_^
#7
Posted 25 March 2010 - 04:37 PM
That thing actually looks like real code....lol
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:
#8
Posted 26 March 2010 - 04:46 AM
lintwurm said:
@CDG10620: every time I see your snippet I have to lol...
^_^
^_^
That snippet is in a lot of places now. :P lol. I plan on posting it every time I see someone post this crap. :)
-CDG10620
Software Developer
Software Developer


Sign In
Create Account

Back to top









