[ create a new paste ] login | about

Link: http://codepad.org/BnIIWpOg    [ raw code | output | fork ]

C, pasted on Sep 3:
#include<stdio.h>
#include<conio.h>
typedef struct
{
 int month;
 int day;
 int year;
} date;

struct bill
{
  char name[8];
  int acc_no;
  float total;
  float pay;
  date time;

}  cus;

float mou(char name[] ,int acc_no ,float pay);
int main()
{
   printf("\n enter  namet \n ");
for(int i=0;i<8;i++)
scanf("%c  ",&cus.name[i]);
printf("\n enter acc_no \n ");
scanf("%d  ",&cus.acc_no);
printf("\n enter payment \n ");
scanf("%f  ",&cus.pay);
   cus.total=mou(cus.name,cus.acc_no,cus.pay);
  printf(" \n %f \n ",cus.total);
}
float mou(char name[] ,int acc_no ,float pay)
{
   float cal;

cal=pay+pay;
for(int i=0;i<8;i++)
 printf("%c  ",name[i]);
 printf(" \n %d \n ",acc_no);
 printf("%f",pay);
return cal;
}


Output:
1
2
3
4
5
Line 17: error: conio.h: No such file or directory
In function 'main':
Line 24: error: 'for' loop initial declaration used outside C99 mode
In function 'mou':
Line 38: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: