[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 50 KB, 638x479, introduction-to-programming-with-c-13-638.jpg [View same] [iqdb] [saucenao] [google]
8384775 No.8384775 [Reply] [Original]

can somebody tell me why the fuck this program won't fucking run
__________________________
#include <stdio.h>
#include <stdlib.h>

int main()
{
int number = 0;
printf("Chose your number faggot!\n");
scanf("%d ", &number);
if (number >=5) {


printf("OP is a nigga bish!\n");}
else {
printf("OP is still a faggot");
}

return 0;
}
___________________________


as soon as i enter a number and press "enter", this shit bar just goes down a step instead of running through my if-else statement.

it was meant to be a joke... but it went from a joke on me not being able to write this simple shit on C.

Somebody find the fucking mistake or correct it PLEASE.

Thank you.

>> No.8384784

>>8384775
You have a space in your "%d".

>> No.8384795

>>8384784
thank you thank you thank you

i owe you one anon and feel like a dumbass now thank you

>> No.8384804

>>8384775
Why the fuck are you coding in C in 2016?

#include<iostream>
using namespace std;

int main(){
int number;
cout<<"Chose your number faggot!\n";
cin>>number;
if(number > 4)
cout<<"OP is a nigga bish!\n";
else
cout<<"OP is still a faggot";
return 0;
}

>> No.8384806

>>8384804
C is fun you cunt. C++ is a clusterfuck. Also fuck streams, they are a ridiculous, ugly concept.

>> No.8384820

>>8384804
its because im forced to as a first year mech eng. thats why i never liked coding to be honest with you and that is the only COMP course ill have to take...

>> No.8384829

>>8384804
not only that but what a cluster fuck of nonsense is C++ just looking at it got me disgusted

>> No.8384853

>>8384806
>Also fuck streams, they are a ridiculous, ugly concept
printf("A%cd%ct%ci%c %cs%cb%ct%ce%c?",'n',' ','h','s','i',' ','e','t','r');

>> No.8384855

>>8384775
>>8384784
learn C they said
it's a good starting language they said
it'll teach you good habits they said

fuck all C first language people. I don't hate the language and i've probably written 15k+ lines of code in it (which in c, is about 5 medium sized programs) but it one of the stupidest languages to start with. Java is probably the best to start with if you only go by language characteristics. Only reason it has competition is because it's being phased out in industry.
>>8384806
nd you're just a dumbass

>> No.8384867

>>8384829
scanf("%d", &number)
How is this better?

>> No.8384868
File: 183 KB, 566x690, 1280786169585.jpg [View same] [iqdb] [saucenao] [google]
8384868

>>8384855
>Java is probably the best to start with if you only go by language characteristics

Kill yourself

>> No.8384899

>>8384868
>that horrible reading comprehension
yes, java is the best for learning. Don't rely on images to make your argument for you dumbass specially when you don't even understand it yourself, none of it applies here.
>slow as shit
>graphics layer
>security holes
>delegation
yea. i'm sure those first year students are really going to care about their linked list program running in 50 ms instead of 5. I'm sure they're worried about their JVM running malicious code. Surely they're worried about print delegations in their hello world program and they want "Hello World" printing in industry level graphics and fonts.
fucking moron.
>load of code to do a small task
>vauge error descriptions
and those are just wrong whether your talking about a learning language or not.

>> No.8384925

You want to learn C# as it's the one everyone uses to make ENTERPRISE QUALITY SOFTWARE and thus is the one you'll need to have on your CV if you want to be hired.

Unless you want to get into web dev, in which case have fun with Javascript.

>> No.8384968

>>8384853
Split it up then.

>printf("Event ID: %09d, Method: %s, Computation Time: %.2f s\n", event_id, method, time);
Readable, nice format.

>cout << "Event ID: " << event_id << ", Method: " << method << ", Computation Time: " << time << " s\n";
Unreadable, cluttered and not formatted. Formatting this mess is even worse.

>> No.8384989

>>8384968
>entering the variable to print right after a string describing what you're printing is less readable than a bunch of place holders and format modifiers
I know most of what you're talking about is subjective, but you're an idiot.

>> No.8386639

>>8384804
>Why the fuck are you coding in C in 2016?
I bet you listen to genres like "deep house."