My learning assignments
- add two numbers and print result. (solution)
- multiply two numbers and print result. (solution)
- divide the given number
awith another numberband print resultant decimal number. (solution) - print the remainder of a/b. (solution)
- add the following numbers and print result. 8,7,19,25,1. (solution)
- find the area of given square with side
a. ( solution ) - Farmer Gopal owns a triangular field with height
hand baseb. he wants to store rice grains in the field.find how much maximum grains he can store in the field. (solution ) - John and his dog goes for a walk around a park. Their path follows a circular route around the park. The center of the park is 49 meters from one of the gates at the circular path. They made 6 rounds. Find how much meter they both walked on that day. ( solution )
- find the square root of given number ( solution )
- Print if given number is even/odd. ( solution )
- Find the greatest of given two numbers. ( solution )
- A candy store owner decided to offer free chocolates to kids. He plans to give chocolates based on kid's shirt size as per table below. Write a program to print the number of chocolates to kid gets given his shirt size. (solution)
| shirt size | no. of chocolates |
|---|---|
| XS | 18 |
| S | 9 |
| M | 4 |
| L | 2 |
| XL | 1 |
- Find the smallest of three integers (solution)
- list all odd numbers from 50 to 100. (solution, solution using mod)
- print sum of integers from 1 to 50. (solution)
- print all factors of given number. (solution)
- print if given number is prime or not. (solution, solution using break)
- print the following pattern. (solution)
*
**
***
****