cant find error:expression syntax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rutukesh
    New Member
    • Nov 2013
    • 2

    cant find error:expression syntax

    #include<stdio. h>
    voidmain()
    {
    int no_days,months, days;
    clrscr();
    printf("enter number of days:");
    scanf("%d",&no_ days);
    months=no_days/30;
    days=no_days%30 ;
    printf("\nmonth s=%d\ndays=%d", months,days);
    getch();
    }
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    please use the 'code' tage when trying to post code

    BTW: The error is on the second line of your code "voidmain() "

    Comment

    • rutukesh
      New Member
      • Nov 2013
      • 2

      #3
      sorry but i dont know the code tag, can you explain.....?
      with example so i can understand better...

      Comment

      • Luuk
        Recognized Expert Top Contributor
        • Mar 2012
        • 1043

        #4
        Code:
        #include<stdio.h>
        voidmain()
        {
        int no_days,months,days;
        clrscr();
        printf("enter number of days:");
        scanf("%d",&no_days);
        months=no_days/30;
        days=no_days%30;
        printf("\nmonths=%d\ndays=%d",months,days);
        getch();
        }

        Comment

        Working...