Problems w/ Structures 'C' -



Problems w/ Structures 'C' -

i need write programme following..i have tried not know going wrong..

define construction dollarsquartersdimes 3 simple variables int dollars, int quarters , int dimes declare monies in dollars, quarters , dimes.

add 2 dollarsquartersdimes monies , store result in 3rd dollarsquartersdimes monies.

remember create necessary conversions dimes , quarters dollar. note: 10 dimes = 1 dollar , 4 quarters = 1 dollar.

#include <stdio.h> #include <stdlib.h> typedef struct{ int dollars; int quarters; int dimes; }dollarsquartersdimes; void main(){ dollarsquartersdimes input1 , input2 , total; printf ("please come in money in order dollars : quarters : dimes ! "); scanf ("%d%d%d" , &input1.dollars, &input1.quarters, &input1.dimes); printf ("please come in 1 time again money in order dollars : quarters : dimes ! "); scanf ("%d%d%d" , &input2.dollars, &input2.quarters, &input2.dimes); input1.dollars = input1.dollars + (input1.quarters/25) + (input1.dimes/10); input2.dollars = input2.dollars + (input2.quarters/25) + (input2.dimes/10); total.dollars = input1.dollars + input2.dollars; printf ("the total value in dollars : %d" , total.dollars); } }

error : getting error homecoming type of error not int. please help !

you need declare main int main:

int main (int argc, char *argv[]) { // ... homecoming 0; }

c

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -