Skip to content

Instantly share code, notes, and snippets.

Created September 4, 2012 19:00

Revisions

  1. @invalid-email-address Anonymous created this gist Sep 4, 2012.
    15 changes: 15 additions & 0 deletions stuff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #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);
    }
    }