Spicy Coders: c
Showing posts with label c. Show all posts
Showing posts with label c. Show all posts

Friday, November 24, 2017

Remaining Balloon Numbers

7 years ago 0

There are N filled balloons each painted with a random number B(i) where i is from 1 to N and the balloons are tied up to a rope in a straight line. M kids who play football arrive and they decide to burst the balloons with the numbers divisibl...

Read More

Monday, November 13, 2017

Characters at multiples of X

7 years ago 2

A string S is passed as the input. A positive integer X is also passed as the input. The program must print the characters at positions which are multiples of X.  Input Format: The first line contains S. The second line contains X.  Outpu...

Read More

Monday, November 06, 2017

Train Journey - Initial Boarding Count

7 years ago 0

In a train journey, there are N stations between station A and B (The train starts from station A). The number of passengers who alighted in station B is passed as the input. The number of passengers who alighted and boarded in the N stations i...

Read More

Tuesday, October 31, 2017

Inner Reduce Pattern Printing

7 years ago 0

Given a number N, the program must print the pattern as described below. Input Format: The first line contains the value of the N which represent the number N.  Boundary Conditions: 2 <= N <= 9 Output Format: The pattern as described ...

Read More

Monday, October 30, 2017

Friend requests in social network

7 years ago 3

In a social network, a person can invite friends of his/her friend. John wants to invite and add new friends. Complete the program below so that it prints the names of the persons to whom John can send a friend request. Input Format: The fir...

Read More

Saturday, October 28, 2017

Collatz Sequence

7 years ago 0

A number N is passed as the input. The program must print the number of steps required for the program to reach Collatz sequence (that is reach 1). Collatz Sequence: Suppose we select some initial number N and then build the sequence of valu...

Read More