Skip to content
Question Bank (5 marks) · Q8

Q.Write a C program to convert the given number of days into months and days. Enter days as 196 days.

Karnataka PUCTextbookLong· 5mImportance★★★★★est
28% · 43/154 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

[!TLDR]

Divide the days by 30: the quotient gives months and the remainder gives the leftover days; 196 days = 6 months and 16 days.

Taking one month as 30 days, the total days are split using integer division and modulus: months = days / 30 and remaining days = days % 30.

#include <stdio.h>
int main()
{
    int days, months, rem;
    printf("Enter the number of days: ");
    scanf("%d", &days);
    months = days / 30;
    rem = days % 30; …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.