Skip to content

Instantly share code, notes, and snippets.

@hocarm
Created March 4, 2018 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hocarm/c570d14521101b80a4ecbc319cba5621 to your computer and use it in GitHub Desktop.
Save hocarm/c570d14521101b80a4ecbc319cba5621 to your computer and use it in GitHub Desktop.
int main(void) {
unsigned long side; // room wall meters
unsigned long area; // size squared meters
UART_Init(); // call subroutine to initialize the uart
printf("This program calculates areas of square-shaped rooms\n");
side = 1;
while(side < 50){
area = Calc_Area(side);
printf("\nArea of the room with side of %ld m is %ld sqr m\n",side,area);
side = side+1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment