Thread: need help

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    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.

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> 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:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed