sign up I login
 advanced
refer a friend - earn nickels!!

Ask & Discuss Questions with Community & Experts

Moderation Team
 90 chars left    advanced
Ask iit jee aieee pet cbse icse state board community Community Discussion Question: A simple problem to solve - Feynmann
Forum Index -> Mechanics like the article? email it to a friend.  
Author Message
feynmann (2236)

Forum Expert Blazing goIITian

Olaaa!! Perrrfect answer. 404  [512 rates]

feynmann's Avatar

total posts: 815    
offline Offline

I know that it is not the right place to ask , still I need it badly


 



First of all please remember that this is not an IIT problem or challenge that I have posted earlier .




 


I am currently working on my thesis paper for my 2nd year engg. course . ( meant to be submitted as early as possible , e.g. by August )




 


Now , all the necessary algorithms and calculations have already been worked out by me but at one place I have got stuck ......................




 


To numerically simulate my algorithm , I need a solution of the following problem .




 


suppose x1, x2 , .....xm are variables that take integer values in the range 0 to ( k-1 ) ,




 


Now list all the possible solution of the eqn




 


                x1 + x2 + .............. + xm = k




 


I need a code ( or mere algorithm would also suffice ) that take the values of (k and m ) during runtime from the user and displays ALL the possible solutions on the screen .




 


Plz help me !!




 


Plz note that a brute force solution is also acceptable as I don't need to submit the program !!




 


The tricky business that is present here is to run a variable no of 'for' loops . Give it a try .




 

    
 
Forum Index -> Mechanics
Go to:   

Top Offers for goIITians
Correspondence Courses
Brilliant Tutorials
Narayana Institute
Aakash Institute
Classroom/Crash Courses
Narayana - Kota , Delhi , Others
Brilliant Tutorials - Class , Crash
Aakash Institute - Medical , Engg
Online Test Series
Brilliant Tutorials
Narayana Institute
Aakash Institute
Mahesh Tutorials
AMITY      Sri Chaitanya