Home
Resources
Latest reviews
Search resources
Forums
New posts
Search forums
Members
Current visitors
New profile posts
Search profile posts
What's new
New posts
New resources
New profile posts
Latest activity
Rules
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Community
Spammm
C++ learning help pls
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
.
Reply to thread
Message
<blockquote data-quote="0xf0rd" data-source="post: 60426" data-attributes="member: 17223"><p>Here is program one, although I know I am not supposed to write for you the program and I want you to learn it by your self but I hope you could learn from it.</p><p></p><p>[code]</p><p></p><p>#include <stdio.h></p><p></p><p>int main()</p><p>{</p><p> int count = 0, number = 0, smallestNumber = 0;</p><p></p><p> printf("Please enter how many number you would like to compare: ");</p><p> scanf_s("%d", &count);</p><p></p><p> for(int i = 0; i < count; i++) {</p><p> printf("Please input number %d: ", i+1);</p><p> scanf_s("%d", &number);</p><p></p><p> if(i == 0)</p><p> smallestNumber = number;</p><p> else if(number < smallestNumber)</p><p> smallestNumber = number;</p><p> else</p><p> continue;</p><p> }</p><p></p><p> printf("The smallest number is: %d", smallestNumber);</p><p></p><p> return 0;</p><p>}</p><p></p><p>[/code]</p></blockquote><p></p>
[QUOTE="0xf0rd, post: 60426, member: 17223"] Here is program one, although I know I am not supposed to write for you the program and I want you to learn it by your self but I hope you could learn from it. [code] #include <stdio.h> int main() { int count = 0, number = 0, smallestNumber = 0; printf("Please enter how many number you would like to compare: "); scanf_s("%d", &count); for(int i = 0; i < count; i++) { printf("Please input number %d: ", i+1); scanf_s("%d", &number); if(i == 0) smallestNumber = number; else if(number < smallestNumber) smallestNumber = number; else continue; } printf("The smallest number is: %d", smallestNumber); return 0; } [/code] [/QUOTE]
Name
Verification
Name a popular topic discussed in the ugbase.eu community
Post reply
Home
Forums
Community
Spammm
C++ learning help pls
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top