Skip to content

Instantly share code, notes, and snippets.

@christianroman
Created August 24, 2012 03:48
Show Gist options
  • Save christianroman/3445232 to your computer and use it in GitHub Desktop.
Save christianroman/3445232 to your computer and use it in GitHub Desktop.
Floating Point digits
/*
* File: main.cpp
* Author: christian
*
* Created on 21 de noviembre de 2011, 14:00
*/
#include <cstdlib>
#include <math.h>
#include <stdio.h>
int main(int argc, char** argv) {
int a;
scanf("%d",&a);
printf("Cifras: %d",(int)floor(log10(abs(a)))+1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment