Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Write a program that ask for user input from 5 to 9 then calculate the average
Write a program that ask for user input from 5 to 9 then calculate the average
✍: Guest
int main()
{
int MAX=4;
int total =0;
int average=0;
int numb;
cout<<"Please enter your input from 5 to 9";
cin>>numb;
if((numb <5)&&(numb>9))
cout<<"please re type your input";
else
for(i=0;i<=MAX; i++)
{
total = total + numb;
average= total /MAX;
}
cout<<"The average number is"<<average<<endl;
return 0;
}
2012-03-28, 4968👍, 0💬
Popular Posts:
What does AddressOf operator do in background ? The AddressOf operator creates a delegate object to ...
How To Get the Last ID Assigned by MySQL? - MySQL FAQs - Managing Tables and Running Queries with PH...
How to create arrays in JavaScript? We can declare an array like this var scripts = new Array(); We ...
How To Download and install PSP Evaluation? - PSP Tutorials - Fading Images to Background Colors wit...
.NET INTERVIEW QUESTIONS - How to prevent my .NET DLL to be decompiled? By design .NET embeds rich M...