+ 3

int num=1;int number;while(num<=5){cin>>number;num++;} what is the process of int number ;

19th Jul 2016, 2:04 PM
Mo D'souza
Mo D'souza - avatar
14 ответов
+ 4
it just always while this for loop is activated ( in this case 5 times ) wants the user to input a number
19th Jul 2016, 2:15 PM
Peter Müller
Peter Müller - avatar
+ 2
Mo D'souza dudu.. we are put int number because int means integer numbers. eg; .....-5,-4,-3,-2,-1,0,1,2,3,4,5,........, if we putting float number then .....-7.00,-6.00,-5.00,-4.00,-3.00,-2.00,-1.00,0,1.00,2.00,3.00,4.00,..........
20th Jul 2016, 1:48 PM
meherDev
meherDev - avatar
+ 1
"number" acts as a variable and every variable is to be declared before using it.
19th Jul 2016, 2:25 PM
deepak h.s
deepak h.s - avatar
+ 1
If you look num is one variable and number is a separate variable. They have to be separate because the tasks use them for different things.
20th Jul 2016, 12:22 AM
Curtis McGuffee
Curtis McGuffee - avatar
+ 1
first it will ask for the number thn it will display that number 5 times it will print until the number we enter will be greater thn 5 :)
20th Jul 2016, 7:10 AM
hajra
hajra - avatar
+ 1
printing whatever you input it as 5 time
24th Jul 2016, 12:27 PM
Natthaphat Jitrattanasophit
Natthaphat Jitrattanasophit - avatar
0
nothing
19th Jul 2016, 2:14 PM
Peter Müller
Peter Müller - avatar
0
then y we are add int number ; line
19th Jul 2016, 2:15 PM
Mo D'souza
Mo D'souza - avatar
0
this is a varible declared to input the number you wish...
20th Jul 2016, 3:22 AM
Nithash Majumdar
Nithash Majumdar - avatar
0
سلام
20th Jul 2016, 5:02 AM
saeid saadih
saeid saadih - avatar
0
let 's try run the code. u wil found out my answered.
24th Jul 2016, 12:30 PM
Natthaphat Jitrattanasophit
Natthaphat Jitrattanasophit - avatar
0
Fill in the blanks to declare a function named "triple" taking an int parameter and returning its value times 3: int triple (int num) { int y; y = num * 3; return y; }
23rd Sep 2022, 4:48 PM
ABDUL WAHAB
- 2
output of program is 1 2 3 4 5
20th Jul 2016, 1:41 PM
meherDev
meherDev - avatar
- 3
y pls like my answer
19th Jul 2016, 2:17 PM
Peter Müller
Peter Müller - avatar