Advertisement
valve2

functions

Mar 3rd, 2023
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2.  float sum(int  a, float b, short c) {
  3.  
  4.     int  s = a + b + c;
  5.     char cs[100] = "hello";
  6.     printf("the sum of abc is %d: ", s);
  7.     return s;   // if we used void we dont have to "return"
  8. }
  9.  
  10. int main() {
  11.     int a;
  12.     float b;
  13.     short c;
  14.     scanf_s("%d %f %hi", &a,  &b, &c);
  15.     sum(a, b, c);
  16.     return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement