Skip to content

Instantly share code, notes, and snippets.

Created September 4, 2012 19:00
Show Gist options
  • Save anonymous/3625047 to your computer and use it in GitHub Desktop.
Save anonymous/3625047 to your computer and use it in GitHub Desktop.
MC
#include <stdio.h>
#include <stdlib.h>
int main(int agrv, char * argc[])
{
float N = 0;
printf("Enter a number?");
scanf("%f", &N);
{
double num = N;
int intpart = (int)num;
double decpart = num - intpart;
printf("Number = %f, Integer = %d, Decimal = %f\n", num, intpart, decpart);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment