Issac is a Language teacher at a high school in Madurai. Sabari is a student, he is studying programming while during Language class. Issac tells Sabari to leave the other subject and learn Tamil. Sabari asked permission for 10 minutes, Finally, Sabri got permission to solve the program.
The computer teacher has given homework on the topic of function and to write the program for conversion of days into year, weeks, and days. . But Sabari is not good at C Programming.
Can you help him to solve the programming problem?
Input:
Number of Days.
Output:
Display days as number of Years, weeks, and days.
#include <stdio.h> int convert(int); int main() { int d; scanf("%d",&d); int weeks,days; weeks=(d-convert(d)*365)/7; days=(d-convert(d)*365)%7; printf("%d Years %d Weeks %d Days",convert(d),weeks,days); return 0; } int convert(int ndays) { return ndays/365; }
INPUT_1:
375
OUTPUT:
1 Years 1 Weeks 3 Days
INPUT_2:
37
OUTPUT:
0 Years 5 Weeks 2 Days
Morae Q!
- Conversion of days into year, weeks and days.
- Find if the number is a perfect number or not.
- Compute conversion of Binary to Octal.
- Return the sum of digits in a number.
- Find if a word exists or not in a sentence.
- Convert Numbers into Words.
- Read a word if it consists only of the letters known.
- Check if the string is a dynamic string or not.
- Convert all Uppercase letters to Lowercase and vice-versa.
- Change the string such that there are no matching adjacent characters.
- Find the number of sub-strings which start and end both in 1.
- Find the start and end index of unsorted sub-array.
- Find the maximum number of pairs that can be formed.
- Figure out the number of bubbly words present.
- Check if a string is lapindrome or not even with a middle character.
- Seating layout in a triangular shaped class according to the number of rows.
- Find and Sort a sub-array which makes whole array sorted.
- Seating layout according to the number of rows.
- Find the final states of the bulbs.
- Check if reversing sub array makes the array sorted.