• Kursy
  • Kompilator kodu
  • Dyskusja
  • Cennik
  • Zespoły
Menu
+ 1

Using a while Loop

int num = 1; int number; int total ; while (num <= 2) { cin >> number; total += number; num++; } cout << total << endl; If the int total is not declare as 0, what will happen?

c++else-statements
8th Apr 2018, 8:56 PM
xin zhang
xin zhang - avatar
1 Odpowiedź
+ 4
https://stackoverflow.com/questions/1597405/what-happens-to-a-declared-uninitialized-variable-in-c-does-it-have-a-value?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
8th Apr 2018, 8:58 PM
Ariela
Ariela - avatar

Często masz takie pytania?

Ucz się bardziej efektywnie, za darmo:

  • Wprowadzenie do Pythona

    7.1M uczących się

  • Wprowadzenie do Java

    4.7M uczących się

  • Wprowadzenie do C

    1.5M uczących się

  • Wprowadzenie do HTML

    7.5M uczących się

Zobacz wszystkie kursy
Popularne dzisiaj
How to properly reverse a string in python
5 Votes
Using Python on VScode
2 Votes
Python Developer
0 Votes
hi my coding instor told me to make a calculator that find the average of two numbers can you pls tell me my erro
0 Votes
Hi guys I need some one to teach the String name how I can do it true because when I finish coding they give me NO OUTPUT
1 Votes
Hearts
1 Votes
Wayss
0 Votes
fully dynamic arrays
1 Votes
Guys who tell me
0 Votes
Question
0 Votes