- #1
WMDhamnekar
MHB
- 359
- 28
- TL;DR Summary
-
I have downloaded and installed ' C c-programs application from Microsoft Windows store. I copied one program named 'Days Convertion' from it to my Notepad++ and saved it as c source file in the Documents folder. When I tried to compile it using gcc, gcc said No such file or directory. How can I fix this error?
When I tried to run this c program in online IDE, it showed several compiling errors. https://ide.geeksforgeeks.org/?ref=ndm
C:
/* Write a c program to convert given number of days to a measure of time
* given in years, weeks and days. For example 375 days is equal to 1 year
* 1 week and 3 days (ignore leap year)
*/
#include stdio.h
#define DAYSINWEEK 7
void main()
{
int ndays, year, week, days;
printf("Enter the number of days\n");
scanf("%d",&ndays);
year = ndays/365;
week = (ndays % 365)/DAYSINWEEK;
days = (ndays%365) % DAYSINWEEK;
printf ("%d is equivalent to %d years, %d weeks and %d days\n",
ndays, year, week, days);
}
/*-----------------------------------------------
When I tried to compile it using gcc at windows command prompt, I got the following error several times. After giving this command at command prompt, 'DaysConvertion.c' file disappeared from the Documents folder.
How can I fix this error?