Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Pure VPN - Up to 27 Months
vgp
Updated:
Friday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
C++ help please
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Dead Island" data-source="post: 13581249" data-attributes="member: 396558"><p>Hi. I solved two questions , it's up to you to solve the rest </p><p></p><p>[code]</p><p>#include <iostream></p><p></p><p>//Function Prototypes</p><p>void qFive();</p><p>void Questions();</p><p>void qSix();</p><p></p><p>int main()</p><p>{</p><p> using namespace std;</p><p> Questions();</p><p> cout << "Press any key to exit;" << endl;</p><p> cin.get();</p><p> return 0;</p><p>}</p><p></p><p>void Questions()</p><p>{</p><p> using namespace std;</p><p></p><p> cout << "Type the question number to proceed. Press 0 To Exit" << endl;</p><p> int qNum;</p><p> if(cin >> qNum)</p><p> {</p><p> switch(qNum)</p><p> {</p><p> case 5:</p><p> qFive();</p><p> break;</p><p> case 0:</p><p> break;</p><p> case 6:</p><p> qSix();</p><p> break;</p><p> default:</p><p> break;</p><p> }</p><p> }</p><p> //reset the error flag</p><p> cin.clear();</p><p> while(cin.get() != '\n')</p><p> {</p><p> continue;</p><p> }</p><p>}</p><p></p><p></p><p>void qFive()</p><p>{</p><p> using namespace std;</p><p> //Calculate the Factorial value of the given number</p><p> cout << "Write down a number to calculate its factorial value" << endl;</p><p> int num,temp;//5 = 5*4*3*2*1</p><p> cin >> num;</p><p> cout << "Typed Value " << num << endl;</p><p> temp = num;</p><p> while(1)</p><p> {</p><p> num--;</p><p> if(num==0)break;</p><p> temp = temp * (num);</p><p> }</p><p></p><p> cout << "Its Factorial value " << temp << endl;</p><p></p><p> //Reask the Questions ,Looping</p><p> Questions();</p><p>}</p><p></p><p>void qSix()</p><p>{</p><p> //receive 10 numbers and the display maximum number out of it</p><p> using namespace std;</p><p></p><p> cout << "Write 10 Numbers to get its Maximum value" << endl;</p><p> double* num = new double[10];//3 9 1 5</p><p> for(int i=0;i<10;i++)</p><p> {</p><p> cin >> num[i];</p><p> }</p><p></p><p> int maxValue;</p><p> maxValue = num[0];</p><p></p><p> for(int i=0;i<10;i++)</p><p> {</p><p> if(maxValue == num[i])</p><p> {}</p><p> else if(maxValue < num[i])</p><p> {</p><p> maxValue = num[i];</p><p> }</p><p> else if(maxValue > num[i])</p><p> {}</p><p> }</p><p></p><p> cout << "The Maximum number out of 10 is " << maxValue << endl;</p><p></p><p> delete[] num;</p><p>}</p><p>[/code]</p></blockquote><p></p>
[QUOTE="Dead Island, post: 13581249, member: 396558"] Hi. I solved two questions , it's up to you to solve the rest [code] #include <iostream> //Function Prototypes void qFive(); void Questions(); void qSix(); int main() { using namespace std; Questions(); cout << "Press any key to exit;" << endl; cin.get(); return 0; } void Questions() { using namespace std; cout << "Type the question number to proceed. Press 0 To Exit" << endl; int qNum; if(cin >> qNum) { switch(qNum) { case 5: qFive(); break; case 0: break; case 6: qSix(); break; default: break; } } //reset the error flag cin.clear(); while(cin.get() != '\n') { continue; } } void qFive() { using namespace std; //Calculate the Factorial value of the given number cout << "Write down a number to calculate its factorial value" << endl; int num,temp;//5 = 5*4*3*2*1 cin >> num; cout << "Typed Value " << num << endl; temp = num; while(1) { num--; if(num==0)break; temp = temp * (num); } cout << "Its Factorial value " << temp << endl; //Reask the Questions ,Looping Questions(); } void qSix() { //receive 10 numbers and the display maximum number out of it using namespace std; cout << "Write 10 Numbers to get its Maximum value" << endl; double* num = new double[10];//3 9 1 5 for(int i=0;i<10;i++) { cin >> num[i]; } int maxValue; maxValue = num[0]; for(int i=0;i<10;i++) { if(maxValue == num[i]) {} else if(maxValue < num[i]) { maxValue = num[i]; } else if(maxValue > num[i]) {} } cout << "The Maximum number out of 10 is " << maxValue << endl; delete[] num; } [/code] [/QUOTE]
Insert quotes…
Verification
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom