09. Conditionals Questions
09. Conditionals Questions
(Assignment Questions)
Question 1 : Write a C++ program to get a number from the user and print whether
it's positive, negative or zero.
Question 2 : Write a C++ program that takes a year from the user and print whether
that year is a leap year or not.
.
Hint : A leap year is exactly divisible by 4 except for century years (years ending with
00). The century year is a leap year only if it is perfectly divisible by 400.
Eg : 1999 is not a leap year
2000 is a leap year
2004 is a leap year
Question 5 : For any 3 digit number check whether it’s an Armstrong number or not.
Armstrong number is a number that is equal to the sum of cubes of its digits.
Eg : 371 is an armstrong number.
3*3*3 + 7*7*7 + 1*1*1 = 371
Bonus : Read up about the difference between typedef (keyword), macros & const
(keyword) in C++.
https://t.me/+nEKeBr_yhXtmY2Yx
https://telegram.me/+nEKeBr_yhXtmY2Yx