Message Board Basketball Forum - InsideHoops if you don't have visual studio 2010 don't even come here
 Register FAQ Members List Calendar Mark Forums Read

 02-18-2014, 11:53 PM #16 Bandito NBA Legend     Join Date: Jul 2009 Posts: 16,660 Re: if you don't have visual studio 2010 don't even come here Code: ```// cap2 2.19.cpp : Defines the entry point for the console application. //Este programa calcula la suma, resta, multiplicacion, promedio, el mas pequeno y el mas grande de tres numeros #include "stdafx.h" #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int n1, n2, n3, sum, sub, mult, ave, smallest, largest;//Inicializar variables cout<<"Input three integers "; cin>>n1>>n2>>n3;//Numeros que el usuario anade sum = n1+n2+n3;//suma de los numeros sub = n1+n2+n3;//resta de los numeros mult = n1*n2*n3;//multiplicacion de los numeros ave = sum/3;// este es los calculos del promedio if (n1>n2)//Este if statement me calcula cual es el mas grande de los numeros { if(n1>n3) largest = n1; else if (n2>n3) largest = n2; else largest = n3; } else { if (n2>n3) largest = n2; else largest = n3; } if (n1
02-18-2014, 11:54 PM   #17
Bandito
NBA Legend

Join Date: Jul 2009
Posts: 16,660
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by shaq2000 Also, your average variable should be a float or double and make sure to avoid integer division: Code: ```double ave; ave = sum / 3.0;```
I want it to be an integer

I don't want decimals on that shiet.

02-18-2014, 11:55 PM   #18
Bandito
NBA Legend

Join Date: Jul 2009
Posts: 16,660
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by Draz Came to say hello
sup

02-19-2014, 12:01 AM   #19
shaq2000
mde

Join Date: Jul 2012
Location: Encino, CA
Posts: 738
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by Bandito I want it to be an integer I don't want decimals on that shiet.

Well, then you won't always be getting the average.

02-19-2014, 12:04 AM   #20
ace23
*****

Join Date: May 2011
Location: Houston, TX
Posts: 9,487
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by Bandito I want it to be an integer I don't want decimals on that shiet.
Do you not want to round up in any case?

02-19-2014, 12:08 AM   #21
Bandito
NBA Legend

Join Date: Jul 2009
Posts: 16,660
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by shaq2000 Well, then you won't always be getting the average.
True, but I am going by the book for now. It will probably start to talk about float, double, char etc...in the next chapter... I am going by the book so I can understand the basics first.

 02-19-2014, 12:09 AM #22 Bosnian Sajo Why?     Join Date: Feb 2010 Location: The ISH Grim Reaper Posts: 10,572 Re: if you don't have visual studio 2010 don't even come here Kobe > Lebron
02-19-2014, 12:10 AM   #23
Bandito
NBA Legend

Join Date: Jul 2009
Posts: 16,660
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by ace23 Do you not want to round up in any case?
nope

02-19-2014, 12:10 AM   #24
Bandito
NBA Legend

Join Date: Jul 2009
Posts: 16,660
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by Bosnian Sajo Kobe > Lebron
I am going to make an app like that and call it ISH app or something just for the lulz....

02-19-2014, 12:16 AM   #25
kings fan

Join Date: Sep 2011
Posts: 1,359
Re: if you don't have visual studio 2010 don't even come here

Writing a line like this
Quote:
 int largest;
is called "declaring an int". This is not the same as "initializing an int". Initializing an int looks like
Quote:
 int largest; // declare largest = 0; // initialize or int largest = 0; // declare and initialize on the same line.
Some languages/compilers will automatically initialize ints to 0, but I guess C++ or your compiler doesn't.

02-19-2014, 12:20 AM   #26
Bandito
NBA Legend

Join Date: Jul 2009
Posts: 16,660
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by cuad Writing a line like this is called "declaring an int". This is not the same as "initializing an int". Initializing an int looks like Some languages/compilers will automatically initialize ints to 0, but I guess C++ or your compiler doesn't.
Oh in C++ when they mean by initialize they mean that the variable doesn't have an value assigned to it after it was declared. At least that's how I took it when I saw the error in the compiler.

But yes you are right.

 02-19-2014, 12:23 AM #27 MadeFromDust exercise profits littl     Join Date: Jun 2006 Location: I come from a dusty place. Posts: 2,617 Re: if you don't have visual studio 2010 don't even come here Make it pop-up a window and output to that instead of using "console" and ill-advised "system" calls
 02-19-2014, 01:09 AM #28 nathanjizzle #Trump4Treason     Join Date: Apr 2011 Posts: 15,190 Re: if you don't have visual studio 2010 don't even come here Any one know where I can start learning python
02-19-2014, 07:25 AM   #29
Bandito
NBA Legend

Join Date: Jul 2009
Posts: 16,660
Re: if you don't have visual studio 2010 don't even come here

Quote:
 Originally Posted by nathanjizzle Any one know where I can start learning python
If you already know how to program just check out any good phyton website. I bought a book called phyton : programming from oreilly which i am using to learn phyton.

 02-19-2014, 08:15 AM #30 embersyc Lurker     Join Date: Jun 2006 Location: Detroit Posts: 4,534 Re: if you don't have visual studio 2010 don't even come here Unless you specifically need the windows forms, check out Qt. http://qt-project.org/ It's free and open source and really optimized for mobile development. Who knew there were so many programmers on ISH?

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home InsideHoops Main Basketball Forums     NBA Forum     College and High School Basketball Forum     Off the Court Lounge     Fantasy Basketball Forum         Fantasy Premier League     Football Forum     Sneaker Forum     Video Games Forum     Streetball Forum     G League Forum, Minor League and International Basketball Forum     NBA Draft Forum     WNBA Forum NBA Team Forums     Atlanta Hawks Forum     Boston Celtics Forum     Brooklyn Nets Forum     Charlotte Hornets Forum     Chicago Bulls Forum     Cleveland Cavaliers Forum     Dallas Mavericks Forum     Denver Nuggets Forum     Detroit Pistons Forum     Golden State Warriors Forum     Houston Rockets Forum     Indiana Pacers Forum     Los Angeles Clippers Forum     Los Angeles Lakers Forum     Memphis Grizzlies Forum     Miami Heat Forum     Milwaukee Bucks Forum     Minnesota Timberwolves Forum     New Orleans Pelicans Forum     New York Knicks Forum     Oklahoma City Thunder Forum     Orlando Magic Forum     Philadelphia 76ers Forum     Phoenix Suns Forum     Portland Trail Blazers Forum     Sacramento Kings Forum     San Antonio Spurs Forum     Seattle SuperSonics Forum     Toronto Raptors Forum     Utah Jazz Forum     Washington Wizards Forum

All times are GMT -4. The time now is 09:36 PM.

NBA Rumors

NBA Videos

Search Site

Instagram