need help

This is a discussion on need help within the C Programming forums, part of the General Programming Boards category; i need help my program is not running Code: #include <stdio.h> #include <stdlib.h> #include <conio.h> struct date { int day ...

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    62

    need help

    i need help my program is not running


    Code:
    
    
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    
    
    struct date
    {
    int day ;
    int month;
    int year;
    };
    
    struct vechile
    {
    char model[20];
    struct date last;
    int time;      
    };
    
    main()
    {
        // struct vehicle cars[20];
         int x,i,cars, day;
         printf("how many cars");
         scanf("%d",&x);
         for(i=0; i<x; i++)
         {
           printf("car model =>");
           fflush(stdin);
           gets(cars[i].model);
           printf("date of last services", day, month, year);
           scanf("%d,%d,%d",&cars[i].last.day&cars[i].last.month,&cars[i].last.year);              
           printf("how many times cars is served per year");
           scanf("%d",&cars[i].times);
           for(i=0;i<x;i++);
           {
           printf("car% %s is due", cars[i] model);
           }
         }
         getch();
         }// end of main() 
         
    }
    
    
    { 
         int d,m,y;
         d =veh.last.day;
         m=veh.last.month+12/veh.times;
         if(m>12)
         {
                 m=m-12;
                 y=veh.last.year+1;
         }
         else
         {   
         y=veh.last.year;
         printf("%d\%\%d",d,m,y);
         }
    }
    Last edited by joker_tony; 06-22-2009 at 10:49 PM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    i want you to criticize my code, so i can improve it
    Why bother?

    You're just going to ignore us, then edit all your threads to cover your tracks (which by the way has made all your past threads totally meaningless).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,699
    >> i need help my program is not running

    Well, naturally. It won't compile. If you want meaningful responses, you're going to need to state the problem precisely, and follow-up on your posts. Otherwise, you're just going to be ignored.
    Code:
    bool fun(bool value)
    {
        return std::pow(std::exp(1), std::complex<float>(0, 1) 
        * std::complex<float>(std::atan(1)*(1 << (value + 2))))
        .real() > 0;
    }

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21