Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Help with Multiples program code

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 11-21-2012, 08:15 PM PM User | #1 Benja303 New to the CF scene   Join Date: Nov 2012 Posts: 3 Thanks: 0 Thanked 0 Times in 0 Posts Help with Multiples program code I need to create a pseudocode to calculate the sum of the multiples of 4 and 7 between a certain range m and n which will be inputted by the user. Here is what i tried so far Begin Display “Please enter the smaller number in your range” Input m Display “Please enter the larger number in your range” Input n Incrementor=1 DO Multiples4=4*incrementor Multiples7=7*incrementor IF Multiple4 <=n AND >=m Sum=Sum+Multiples4 Endif IF Multiples7 <=n AND >=m Sum=Sum+Multiples7 Endif Incrementor=incrementor+1 WHILE Multiples4 and Multiples7 <=n It's just a snipped but There are many problems with this as you can see. A friend of mine was suggesting divide by the number and then check to see if there is a remainder instead or something. I need some help. Please suggest a method
 12-15-2012, 05:40 AM PM User | #2 JefferyJamison New Coder   Join Date: Sep 2012 Location: USA Posts: 13 Thanks: 0 Thanked 2 Times in 2 Posts Hi ! I gave one example may be it will help you. //Find the sum of all the multiples of 4 or 7 below 1000. #include #include void main () { int a,b,i,iSum=0; clrscr(); for (i=1;i<1000;i++) { a = i%4; b = i%7; if(a==0||b==0) { iSum += i; } } printf("\nThe sum of all the multiples of 4 or 7 below 1000: %d\n", iSum); getch(); }

 Bookmarks

 Tags assit, code, multiple

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 11:36 PM.