Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. struct Prekes {
  2. char pavadinimas[50];
  3. char kodas[50];
  4. float kaina;
  5. };
  6.  
  7. static float sudetis(struct Prekes p, struct Prekes p1){
  8. float sum;
  9. sum =p.kaina+p1.kaina;
  10. return sum;
  11. }
  12.  
  13.  
  14. int main(){
  15.  
  16. struct Prekes preke1;
  17. struct Prekes preke2;
  18. strcpy( preke1.pavadinimas, "Telecom Billing");
  19. strcpy( preke1.kodas, "Zara Ali");
  20. preke1.kaina = 20;
  21.  
  22. strcpy( preke2.pavadinimas, "Telecom Billing");
  23. strcpy( preke2.kodas, "Zara Ali");
  24. preke1.kaina = 30;
  25.  
  26.  
  27.  
  28. printf(sudetis(preke1, preke2));
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement