Sunday, 8 July 2012

c program to convert days to months and days

For beginners
{I am going write the c program but before you need a c compiler.there are a lot of compilers. like Code::Blocks, dev c++  Download dev c++ its free and install it in your computer.open  dev c++ go to file-->new-->source file.}  


#include<stdio.h>
#include<conio.h>
main()
{
      int month,day;
      printf("enter days\n");
      scanf("%d",&day);
      month=day/30;
      day=day%30;
      printf("months = %d, days = %d",month,day);
      getch();
      }


For beginners
{After typing this program go to execute-->compile & run-->a window will pop-up-->give file name:(anything u like)-->save as type: c source files-->click save.}


IS IT HELPFIL? comment.

1 comment:

  1. It is not a
    correct program.
    Plz write days instead of day
    Otherwise it will not run.

    ReplyDelete