Nayeemzaman

output trace5

Dec 18th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. struct Distance
  3. {
  4.     int feet;
  5.     double inch;
  6.     char name[10];
  7. };
  8. void printD(struct Distance d)
  9. {
  10.     d.feet++;
  11.     d.inch++;
  12.     printf("feet %d inch %.2lf name %s\n", d.feet, d.inch,d.name);
  13.  
  14. }
  15. int main()
  16. {
  17.     struct Distance d={3,5.22};
  18.     strcpy(d.name,"Mahbub");
  19.     printD(d);
  20.     printf("feet %d inch %lf name %s\n", d.feet, d.inch,d.name);
  21.     return 0;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment