All pastes #489876 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-15 19:06 UTC
rendered paste body
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<windows.h>
#include<time.h>
#include<conio.h>
typedef struct
{
	char nom[40];
	char marque[40];
	char modele[40];
	char type[40];
	char moteur[40];
	char carburant[40];
	float consoville;
	float consoautoroute;
}automobiliste;
int main()
 {
      automobiliste p;
      FILE *f;
       if ((f = fopen("C:\\automo.txt", "w"))==NULL)
      {
  printf("Cannot open file \n");
}
else 
      automobiliste p;
      printf("Nom automobiliste :");
      scanf("%s",&p.nom);
      fputc(p.nom,f);
      printf("la Marque du véhicule :");
      scanf("%s",&p.marque);
      fputc(p.marque,f);
      printf("Modéle du véhicule :");
      scanf("%s",&p.modele);
      fputc(p.modele,f);
      printf("type :");
      scanf("%s",&p.type);
      fputc(p.type,f);
      printf("type Moteur :");
      scanf("%s",&p.moteur);
      fputc(p.moteur,f);
      printf("type du carburant :");
      scanf("%s",&p.carburant);
      fputc(p.carburant,f);
      printf("Consommation en ville ( nombre de litres / 100km ):");
      scanf("%f",&p.consoville);
      fputc(p.consoville,f);
      printf("Consommation sur autoroute (nombre de litres / 100km):");
      scanf("%f",&p.consoautoroute);
      fputc(p.consoautoroute,f);
 }