Where's the mistake? help me plz

where's the mistake? help me plz

programmer fags will understand what I wanted to do.

Other urls found in this thread:

stackoverflow.com/questions/5101997/c-sorting-numbers-from-smallest-to-biggest
toptal.com/developers/sorting-algorithms/
twitter.com/SFWRedditGifs

All of those I statements should be concatenated into one big if-the-else statement

If*

In Java you have to use == for logical comparison
maybe C same

Like this fag said here you need to use "else if"

Yea it's the same. Needs == but I would condense it

Use an array and a loop you faggot

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

What this guy said. Also use else.

Sorry meant c lol

>= 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
}

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

>using assignment operator

Kek. Never gonna make it.

go fuck yourself faggots, doesn't work

>number 1 == number 4 == number 2 == number 3

good job mong

bamp

2 never match 3

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

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

Tl;dr Kys

found the mistake in line 24. kek. im so retarded

Oh yeah? Post results

you need to add "\n" to the end of the strings for a new line

also, use "==" in parameters

Nigger, you never said 2 and 3 can't be the same.

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

You dont have a if 2==3 condition.

go hang yourself and never post here again

...

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

Nigger what are loops and arrays

int main ()
{
printf("You're a massive faggot.");

return0;
}

i wanted to to sort the input numbers by their value. but no idea how to do that...

no shit monkey boy, obviously he just wants the inputs for now and wants to get that working

unneeded, especially when the dude clearly knows NOTHING

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

It's

return 0; you fucking faggot, return0 wouldn't compile, hang yourself

google you braindead monkey

please stop programming and delete you IDE

number1 == number4 || number2 == number3

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

Jesus fucking christ

find me a source and I'll kiss your ass you fucking degenerate faggot. already tried it

>printf
>not puts

>not averaging the numbers to speed up the process

fuck you are retarded

stackoverflow.com/questions/5101997/c-sorting-numbers-from-smallest-to-biggest
has a link to
toptal.com/developers/sorting-algorithms/

if you can't figure out how to google you'll never be decent at programming

What is bubble sort

its impossible in cpp you idiot

that's not c++

>simple task without even including math.h
>impossible

wat?

use a switch statement

>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

found the newfag

>book
>2017
come on

#include

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

how's minimum wage life going?

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)#

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!

bool duplicate = false;
for (int i = 0; i< 4; i++)
{
for (int j = i+1; j

Don't run that code! It's a virus.

op here. may i ask you how long you needed for that?

>take 4 years of comp sci in highschool from a legit engineer
>get to college
>"lol user, no one teaches programming in high school, take all this shit again"
>4.0 every class, blaze through finals in half an hour
>"wow user, you are a natural, plz tutor our python class"

This thread is a snap shot of my fucking life.

>fucked up the duplicate checking results
oh well there's worse bugs

le Sup Forums 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

fuck you i own 5 programming textbooks

i think that says more about me than you, though...

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?

"=" 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.

le ironic haha le shitposterino XD
le showed them haha oopsie doopsie I banned

Here user, got your next post ready for you

>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

2 minutes - I am not a fast programmer

itt arrogant people

it's past midnight but

im dying

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)
}

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

dumbass

I said that
also c isn't oop no methods silly willy

and dont waste memory, declare like int number1, number2, number3, number4

then go learn some legit progrmming language, like c# or java

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

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.

didn't mean to tag you on mobile ;_;

Mods move this thread to Sup Forums and watch them implode for the kek

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.

What you up to these days?

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.

those tiny little components

Sounds relaxing, you keep doing you man :) I'm gonna keep slogging it out with the other code monkey ^^;

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.

Yep transistors, resistors, controllers, soldered CPUs and GPUs, and everything in between.

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.

checkd
>MODS

bad bait is bad

Bit envious user - 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?

Nice set up*

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.

Bad bait caught two fishes