Advertisement
andruhovski

prog0106-demo

Sep 5th, 2014
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <math.h>
  3.  
  4. double sum_pdv(double p, int q)
  5. {
  6.     p=111.44;
  7.     return p*q*1.2;
  8. }
  9. void swap(int *x,int *y)
  10. {
  11.     int z=*x;
  12.     *x=*y;
  13.     *y=z;
  14.     return;
  15. }
  16.  
  17. int _tmain(int argc, _TCHAR* argv[])
  18. {
  19.     setlocale(LC_ALL, "Ukrainian");
  20.     double price=100.10;
  21.     int quantity = 23,a,b;
  22.     double sum=sum_pdv(price, quantity);
  23.     printf("Сума з ПДВ для ціни %6.2f і к-сті %d є %6.2f грн.\n",
  24.         price, quantity, sum);
  25.     a=6; b=8;
  26.     printf("\n%d %d\t",a,b);
  27.     swap(&a,&b);
  28.     printf("%d %d",a,b);
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement