NIRAL 2014 Code Guru - Finals: Name: - Name

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

NIRAL 2014

CODE GURU FINALS


Duration: 1 hour
Niral ID : __________________ Name : _____________________
Niral ID : __________________ Name : _____________________
College : __________________ Mobile No:_____________________
College : __________________ Mobile No:_____________________
1) Write a c program to create a text file in desktop with the name Niral and
insert the text into the file Welcome to niral

2) Write a program for the following problem(c/c++/Java)
Old man has gold coins and he has 1 manager, 5 sons, and 5 daughters. He is
going to share his gold coins to his sons, daughters and manager.
I) First he gives one coin to manager then 1/5 to his first son
II) Again he gives one coin to manager, then 1/5 to his second son, from
balance coins and so on in this manner
III) In end of sharing he has some amount of coins and he gives equal share to
all daughters (No share to manager in this case)
Conditions:
At the end of sharing there should not be any coins remaining
We cant share single coin to more than one members, i.e. share should
not be in fraction
Mention the total coins the old man initially had and total coin each son,
daughter, and manager would get at the end.


ALL THE BEST!

You might also like