Skip to content

Instantly share code, notes, and snippets.

@northofnormal
Created February 26, 2018 16:28
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 northofnormal/74487dd6296ec565833fbc2959c89830 to your computer and use it in GitHub Desktop.
Save northofnormal/74487dd6296ec565833fbc2959c89830 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main (void) {
float d = 6.5;
float half, square, cube;
half = d/2;
square = d*d;
cube = d*d*d;
printf("\nYour number is %.2f\n", d);
printf("\nHalf of that is %.2f\n", half);
printf("\nSquare it to get %.2f\n", square);
printf("\nCube it to get %.2f\n", cube);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment