Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- struct Distance
- {
- int feet;
- double inch;
- char name[10];
- };
- void printD(struct Distance d)
- {
- d.feet++;
- d.inch++;
- printf("feet %d inch %.2lf name %s\n", d.feet, d.inch,d.name);
- }
- int main()
- {
- struct Distance d={3,5.22};
- strcpy(d.name,"Mahbub");
- printD(d);
- printf("feet %d inch %lf name %s\n", d.feet, d.inch,d.name);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment