[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

where's the mistake? help me plz programmer fags will understand

The stories and information posted here are artistic works of fiction and falsehood.
Only a fool would take anything posted here as fact.

Thread replies: 99
Thread images: 10

File: helpme.png (66KB, 1292x667px) Image search: [Google]
helpme.png
66KB, 1292x667px
where's the mistake? help me plz

programmer fags will understand what I wanted to do.
>>
All of those I statements should be concatenated into one big if-the-else statement
>>
>>728133412
If*
>>
>>728133139
In Java you have to use == for logical comparison
maybe C same
>>
>>728133412
Like this fag said here you need to use "else if"
>>
>>728133507
Yea it's the same. Needs == but I would condense it
>>
Use an array and a loop you faggot
>>
>>728133139
retard, use == for logical comparison
go hang yourself

if (1 == 2 || 1 == 3 || 1 == 4 || 2 == 3 || 2 == 4 || 3 == 4)
>you're a nigger

else
>jesus christ was that so hard
>>
>>728133507
What this guy said. Also use else.
>>
>>728133139
Sorry meant c lol
>>
>>728133139
>= instead of ==
>also thurd
learn to spell before you call yourself a nigger you nigger
>>
needs some ternary lovin. also == not =.
= is assignment
== is logical comparison
=== is some super shit that compares types or whatever idk but it exists
>>
faggot you need "==" in your if statement
>>
if (1 == 2 ....){
asdgfdsg
}else{
adsfasdf
}
>>
>>728134171
yes?
are you implying it should be and or some shit?

you could probably do it with loops but it'd most likely be more work and less efficient
might as well do it the simple way
>>
just concatenate the 4 numbers as a string and then match each individual number against the string
if it's in there twice you'll know
>>
>>728133139

>using assignment operator

Kek. Never gonna make it.
>>
File: youreallfags.png (57KB, 1007x705px) Image search: [Google]
youreallfags.png
57KB, 1007x705px
>>728133507
>>728133652
>>728133685
>>728133829
>>728133882
>>728133990
>>728134018
>>728134076

go fuck yourself faggots, doesn't work
>>
>>728134740
>number 1 == number 4 == number 2 == number 3

good job mong
>>
bamp
>>
>>728134740
2 never match 3

you're deeply retarded but keep on trying that's the only way
>>
>>728134740

Your program a shit and the real 'nigger' here is you.

Tl;dr Kys
>>
>>728134740
found the mistake in line 24. kek. im so retarded
>>
>>728135322

Oh yeah? Post results
>>
>>728133139
you need to add "\n" to the end of the strings for a new line

also, use "==" in parameters
>>
>>728134740
Nigger, you never said 2 and 3 can't be the same.

Also drop the 1=2=3=4 part. It's completely unnecessary.
>>
>>728135322

You dont have a if 2==3 condition.
>>
>>728135322
go hang yourself and never post here again
>>
File: gggggggggggggggg.png (56KB, 1048x707px) Image search: [Google]
gggggggggggggggg.png
56KB, 1048x707px
>>728135546
>>
You have to stop using "please" and "nigger" in the same sentence unless it's "nigger, please"
>>
you're just printing text it's not actually calculating anything... or whatever you're doing , you have to set the users response to actually be imputed into the program
>>
>>728135874

Nigger what are loops and arrays
>>
>>728135717
int main ()
{
printf("You're a massive faggot.");

return0;
}
>>
>>728136002
i wanted to to sort the input numbers by their value. but no idea how to do that...
>>
>>728136002
no shit monkey boy, obviously he just wants the inputs for now and wants to get that working

>>728136029
unneeded, especially when the dude clearly knows NOTHING

>>728136100
> return0;
good job faggot, will give you a compiler error
>>
>>728136100

It's

return 0; you fucking faggot, return0 wouldn't compile, hang yourself
>>
>>728136192
google you braindead monkey
>>
>>728134740
please stop programming and delete you IDE

number1 == number4 || number2 == number3
>>
>>728136199

>loop through array unneeded
>with 6 OR statements in one IF

Jesus fucking christ
>>
>>728136420
find me a source and I'll kiss your ass you fucking degenerate faggot. already tried it
>>
File: 1483072794311.webm (1MB, 1280x720px) Image search: [Google]
1483072794311.webm
1MB, 1280x720px
>>728136100
>printf
>not puts
>>
File: 1445623680724.jpg (38KB, 504x470px) Image search: [Google]
1445623680724.jpg
38KB, 504x470px
>not averaging the numbers to speed up the process
>>
>>728133139
fuck you are retarded
>>
>>728136571
http://stackoverflow.com/questions/5101997/c-sorting-numbers-from-smallest-to-biggest
has a link to
https://www.toptal.com/developers/sorting-algorithms/

if you can't figure out how to google you'll never be decent at programming
>>
>>728136571
What is bubble sort
>>
>>728136192

its impossible in cpp you idiot
>>
>>728136831
that's not c++

>simple task without even including math.h
>impossible

wat?
>>
use a switch statement
>>
>>728135322
>uses kek, nigger, faggot, and retarded

are you actually 12? fucking christ man, this is basic shit. set down the razor blades and pick up a book
>>
>>728137010
found the newfag
>>
>>728137010
>book
>2017
come on
>>
#include <stdio.h>

void main()
{
int i=0, j=0, check=0;
int number[3];
do{
check = 0;
printf("Choose four different numbers sir: \n\n");
for(int i =0; i<4;i++){
scanf("%d", &number[i]);
}

if(number[0] == number[1] || number[0] == number[2] ||number[0] == number[3] || number[1] == number[2] || number[1] == number[3] ||number[2] == number[3]) check = 1;

if(check==1) { printf("two of your numbers match sir...try again.");}
else printf("Good job!");
} while(check!=0);
printf("\n\nOP is a faggot.");
}

done. now get out.
>>
>>728137315
how's minimum wage life going?
>>
>>728136831
comparing 2 variables and saving their values to another variable sure is impossible in cpp :^)
>>
this is now a coding cringe thread
>>
10 PRINT "ITT: PEOPLE TRY TO SHOW OFF"

def void const main[]}
printf.gets('am I gud programer')#
return "zero"#
{

def. main(run, program)#
>>
>>728136192
google something like bubblesort or quicksort. you simply have to understand how it works and then you can implement it in pretty much any language
>>
You cunt. You didn't initialise your variables. You deserve your soulless bank job now!
>>
>>728137406
bool duplicate = false;
for (int i = 0; i< 4; i++)
{
for (int j = i+1; j<4;j++)
{
if (number[i] == number[j]) duplicate = true;
}
}

if duplicate
good job
else
bad pupper

prob better approach if you're gonna complexicatify it
past midnight so might be a problem in there, but oh well
>>
Don't run that code! It's a virus.
>>
>>728137406
op here. may i ask you how long you needed for that?
>>
>>728137543
>take 4 years of comp sci in highschool from a legit engineer
>get to college
>"lol anon, no one teaches programming in high school, take all this shit again"
>4.0 every class, blaze through finals in half an hour
>"wow anon, you are a natural, plz tutor our python class"

This thread is a snap shot of my fucking life.
>>
>>728137820
>fucked up the duplicate checking results
oh well there's worse bugs
>>
>>728137226
le /b/ is edgy meme xddddd

look, i get that you think the word nigger is funny because you're a sheltered 15-year-old living in his dad's house after the divorce, and you probably think you're hot shit because you own a rx 480/i3 build (with 16GB of ram xdd), but this guy is clearly just "le nigger word, get it? it's funny because i'm racist!".

kys
>>
>>728137315

fuck you i own 5 programming textbooks

i think that says more about me than you, though...
>>
>>728137852
i didnt write that but its about 5 min work
>>
> Inb4 PHP for faggots

$array = array("a", "a", "b", "c");
echo array_is_unique($array) ? "unique" : "non-unique";

Why not store your data in arrays or objects?
>>
>>728133139
"=" should be replaced with "==" in each statement.
= checks if a can be given the value of b - since all are integer the check passes as true
== checks if a is the same value as b
=== checks if a is the same value and data type as b

you should use if-else statements
you should actually use cases, would make the code more readable.
>>
>>728137958
le ironic haha le shitposterino XD
le showed them haha oopsie doopsie I banned

Here anon, got your next post ready for you

>>728138045
>teacher tells us to buy book
>download ebook
>don't have to lug around 800 page books save the 70 solar systems it would have cost to buy the book
What were they thinking
>>
>>728137852
2 minutes - I am not a fast programmer
>>
>>728137854
itt arrogant people
>>
File: yes.gif (1MB, 480x270px) Image search: [Google]
yes.gif
1MB, 480x270px
>>728137820
it's past midnight but
>>
>>728135309

im dying
>>
>>728136192
PHP
$a = array('1','1','2',5');
echo array_unique($a) == $a ? sort($a) : 'ya got dupes';
>>
Also cuntface this program is fucking useless, you tell them to pick another number, then don't give them a chance to fix it

try something like this:
printf("pick a number cunt)
scanf("%d", &num1);

printf("Pick another one")
scanf("%d, &num2)
while (num1==num2){
printf("I said pick another number,cunt. Try again")
scanf("%d",&num2)
}

printf("3rd number")
scanf()
while(num1==num3||num3==num2){
printf("try again")
scanf("%d",&num3)
}
>>
>>728133139
Because you're fucking initializing the numbers without fucking setting them, therefore they are all fucking equal. Thanks to your absurd multiple if statements, they all are fucking satisfied and they all fucking execute. Fuck you OP.
>>
use methods, user cant. return to reenter data . RECURSION. use SWITCH CASE FOR FUCKS SAKE
>>
File: 1469675298384.jpg (3KB, 125x97px) Image search: [Google]
1469675298384.jpg
3KB, 125x97px
>>728140178
dumbass
>>
>>728140915
I said that
>>728137009
also c isn't oop no methods silly willy
>>
>>728140915
and dont waste memory, declare like int number1, number2, number3, number4

then go learn some legit progrmming language, like c# or java
>>
>>728141047
oh didnt read that, sorry.
method arent objects. objects are created from classes, and yet a class can have infinite method. like the main method, or think further: there are 2 kinds of methods:
procedure and function.

public float(x) {
return x*x
//this is a function;
}


void hello(){
cout>>"hello";
//this is a procedure
}


yet an object is:


class cube : extends shapes {
private float a

void cube(int a){
this.a = a;
}

float area(){
return a*a;
}

this is an object. it uses both method type, just like a normal class, but has its own principles.
>>
Holy shit op is stupid
>>
>>728141560
yeah ik what a method and class is but I'm saying the guy is using C not C++ afaik so usually I refer to them as functions.
>>728142174
>>
>>728142174
didn't mean to tag you on mobile ;_;
>>
Mods move this thread to /g/ and watch them implode for the kek
>>
File: 1490578674188.jpg (132KB, 1280x862px) Image search: [Google]
1490578674188.jpg
132KB, 1280x862px
>>728133139
This thread reminds me of why I left programming. Bunch of fucking autists who sperg out whenever they see someone else make an error. Like they've just conquered a continent by spotting a mistake.
>>
>>728142787

What you up to these days?
>>
>>728142903
I've gone the much more calming route of component level repair for circuit boards. Basically I fix people's dead desktop, laptop, and cell phone boards. The programming field is saturated as fuck these days, and I don't work well with autistics who loose there shit during team work. Toxic environment from my experience.
>>
File: 1206_done.jpg (41KB, 600x237px) Image search: [Google]
1206_done.jpg
41KB, 600x237px
>>728143279
those tiny little components
>>
>>728143279

Sounds relaxing, you keep doing you man :) I'm gonna keep slogging it out with the other code monkey ^^;
>>
>>728135874
This shit but it has to go like this:
if((number1==number2)||(number1==number3)etc..)
The entire condition has to be within these () and you can't compare more than one at the time,for example you can't (number1==number2==number3). If I were you i would just give up programming,i mean this is all basic stuff and you have just been taught by a 16 yo.
>>
>>728143429
Yep transistors, resistors, controllers, soldered CPUs and GPUs, and everything in between.

>>728143547
Yeh for sure, wasn't saying otherwise, I just couldn't handle it myself. I live in a beach front townhouse in the Caribbean now, and have a nice large well ventilated garage with all my equipment. I don't like spending a terrible amount of time around people who aren't friends or close family so this is ideal.
>>
>>728143888
checkd
>MODS
>>
>>728143888
bad bait is bad
>>
>>728143940

Bit envious anon - no e set up by the sounds of it - wouldn't mind a more organised lab by the beach myself! Maybe in a couple decades eh?
>>
>>728144134

Nice set up*
>>
>>728144134
Absolutely man. If you can go the route of working from home and from your own workspace, do it! Only downside to mine is the salt blast from the sea keeps me having to constantly service my equipment so it doesn't degrade, but beggars can't be choosers.
>>
File: Screenshot_2017-04-06-01-34-50.png (110KB, 480x854px) Image search: [Google]
Screenshot_2017-04-06-01-34-50.png
110KB, 480x854px
>>728144113
Bad bait caught two fishes
>>
++ same
|= nus/(list @)
^- tape
=/ res
%+ roll nus
|= {num/@ sam/? las/(unit @)}
?. sam [| `num]
?~ las [& `num]
[=(num u.las) `num]
?: -.res
"well done"
"please enter four different numbers"

pastebin XK51NnLA
Thread posts: 99
Thread images: 10


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.