Advertisement
Adrita

basic function(lab)

May 4th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2. int sum(int a,int b)
  3. {
  4. return a+b;
  5. }
  6. int sub(int a,int b)
  7. {
  8. return a-b;
  9. }
  10. float div(int a,int b)
  11. {
  12. return (float)a/b;
  13. }
  14. int main()
  15. {
  16. int a,b;
  17. scanf("%d %d",&a,&b);
  18. printf("sum is %d\n",sum(a,b));
  19. printf("sub is %d\n",sub(a,b));
  20. printf("div is %f\n",div(a,b));
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement