Uploaded by Shamshad Hossain

Python-Problem-Sheet

advertisement
Problem 1.
Find out whether the input number is divisible by 2 , 3, 4, 5 , 6 , 7 , 8 or 9.
Sample Input : 156141618119181716
Sample Output: 2,4,8
Sample Input: 111222454545182790
Sample Output: 2,3,9
Problem 2.
Write a C program to take 3 sides of a triangle and show the type of the triangle
where it is Isosceles, equilateral, right-angled and scalene or not a triangle.
Sample input
Sample output
10 4 5
445
555
345
643
Not a triangle
Isosceles
Equilateral
right-angle triangle
Scalene
Problem 3.
Write a c program to find the 1st digit of a number.
Sample Input
1010
5438
Sample Output
1
5
Problem 4.
How many triplets (a,b,c) are there, where a+b+c=X and X is an integer and your
input as well as a,b,c >= 0.
Sample Input
10
15
Sample Output
66
136
Download