I'd like to write a program to convert days into years, weeks, and days. I wrote the program, but there is a condition that if the user inputs a character, the output should be Only positive numeric is allowed. But, when I enter a character, it picks the ASCII value of that. I'm not able to understand what condition to put.
#include<stdio.h>
int main(){
    
    int days, year, weeks;
    printf("Enter days: ");
    scanf("%d", &days);
    
    if(days)
    {
        year = days/365;
        printf("\nYears: %d\n", year);
        weeks = (days-(year*365)) / 7;
        printf("Weeks: %d\n", weeks);
        
        days = days-(year*365)-(weeks*7);
        printf("Days: %d\n", days);
    }
    else{
        printf("Only positive numeric is allowed.");
    }
    return 0;
}
Desired Output:

 
     
    