Jump to content
Science Forums

C Programming "if else" help!


Recommended Posts

that would be a bit of an under-statement, but at the time i've already been exposed to a dozen languages, and i was picking up python...

 

ah that explains it. when did you attend college?

Im completely new to programming other than fooling around with Liberty Basic. The sytax is the most confuing part :-)

Link to comment
Share on other sites

Yep, and never finished college, have 38 credits an no degree.

 

But to be honest, even in high school, i was doing independent study in comp-sci for the last year and a half of high school, where i basically got to hang out with our one IT person (of the 3 for the school system) and work on everything with him... And then i got to college, started up comp-sci path, finished when i realized that i was learning more outside of class, not doing the homework that i was supposed to be doing, and playing with stuff i wanted to pay with. I would like to get back to school at some point, but i really dont know how relevant it will be now. I've been working in IT for 6 years, started low, always knew and wanted to do more, got bogged down getting the "experience" points for the resumee, when i ran a network, now i'm finally doing some pretty cool stuff :wave2:

 

liberty basic? you should pick up a real language... like python... problem with languages that dumb down real development is that when people get used to them, they have no clue how to properly code that stuff, and when they do end up getting a real job, or a real project, where everything is C, or C++ or Python, or Java, they have no clue how to even approach creating windows and building a UI. Better yet, get yourself an arduino controller and start playing with that, building various projects with it, i think you would enjoy the challenge behind building the hardware, and then building the firmware for it to work, and eventually having it all work together, not just displaying a text message on the screen ;)

 

those ofcourse are my recommendations as a geek who likes playing with that kind of stuff, infact i'm gonna purchase an arduino kit later on today because i really think that they are great :)

 

And you should use a real development platform, if you are serious about it, you should get familiar with Linux :)

Link to comment
Share on other sites

Yep, and never finished college, have 38 credits an no degree.

 

But to be honest, even in high school, i was doing independent study in comp-sci for the last year and a half of high school, where i basically got to hang out with our one IT person (of the 3 for the school system) and work on everything with him... And then i got to college, started up comp-sci path, finished when i realized that i was learning more outside of class, not doing the homework that i was supposed to be doing, and playing with stuff i wanted to pay with. I would like to get back to school at some point, but i really dont know how relevant it will be now. I've been working in IT for 6 years, started low, always knew and wanted to do more, got bogged down getting the "experience" points for the resumee, when i ran a network, now i'm finally doing some pretty cool stuff :naughty:

 

liberty basic? you should pick up a real language... like python... problem with languages that dumb down real development is that when people get used to them, they have no clue how to properly code that stuff, and when they do end up getting a real job, or a real project, where everything is C, or C++ or Python, or Java, they have no clue how to even approach creating windows and building a UI. Better yet, get yourself an arduino controller and start playing with that, building various projects with it, i think you would enjoy the challenge behind building the hardware, and then building the firmware for it to work, and eventually having it all work together, not just displaying a text message on the screen :turtle:

 

those ofcourse are my recommendations as a geek who likes playing with that kind of stuff, infact i'm gonna purchase an arduino kit later on today because i really think that they are great :shrug:

 

And you should use a real development platform, if you are serious about it, you should get familiar with Linux :tree:

 

I am actually pursuing a network engineering degree. I had to take programming for my high school credits. I am in Johnson and whales early enrollment program, where I skip my senior year and the high school agrees to accept my college credits to graduate. Software development is an interest, but not what I would want to do with my life, I prefer network management, where I work with software and hardware.

Link to comment
Share on other sites

How do you compile? Is there a nifty programming tool (freeware) for XP that will let me keep up?

Are you interested in how compiling is actually done, or are you only interested in the use of an actual tool?

 

I'd highly recommend a gcc-based compiler, infact i'd highly recommend actual gcc, gdb debugger, a combination, though it may seem cumbersome to use at first, are a programmers dream (once you get into more serious stuff)...

 

I prefer network management, where I work with software and hardware.
oh the misconception... depending on what you do, you are more likely to work with more actual hardware if you do some types of programming, then you are while being a network engineer, i know, not only do i know 3-4 high-class (one is a CCIE, another one is the net engineer for Pryme Technologies, third one works on fiber sans, and fiber networs for a pretty big data warehousing company), and i know a couple of softare developer (or maybe a few), most rarely touch hardware, but firmware developers, or security system guys, and some of the r&d guys for service providers, can touch some hardware, sometimes very closely working with it to make really cool things happen... BUT, that is not to deter you from your career goal, just offer you a perspective that you may want to think about switching out to a more generalized field of like computer science or something, then if you wanna be a net engineer, then start taking your cisco courses for the cisco exams, CCNP, CCDP, CCSP and ultimately CCIE would be your goal (its a VERY hard test). On the other hand, maybe you'll catch something you actually want to do and shift your focus to something else, security, hardware, firmware/embeded systems or something. Point being with a little bit of a broader field, you'll learn some of everything, and then you can decided which direction you want to go...

 

And i wouldn't (and didn't) use Visual Studio, its a crappy development platform, but you can call me old school, i like to write my code, and not use some drag and drop tool...

Link to comment
Share on other sites

  • 6 months later...

first problem in your program is that you provided a semicolon in the if and if else statements.

secondly

 

say 3, 2 ,1 be the numbers you are entering then your program will first check 3<2?

this will result in 0 and then try to check 0<1 this is true so it will print the value 3.

like it prints the other values on other if else statements.

 

also use float for storing average. avg=(x+y+x)/3.0; where avg is in float.

if you want to check which is smaller follow this.

 

void main()

{

int x,y,z;

scanf("%d%d%d",&x,&y,&z);

if(x<y && x<z)

{

printf("%d",x);

}

else if(y<x && y<z)

{

printf("%d",y);

}

else if(z<y && z<x)

{

printf("%d",z);

}

 

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...