Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
numerodevecesquerepitedigitoennumero
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#include <stdio.h> #include <stdlib.h> int main(void) { long long N; short d, b; int cifra,i; printf("Introduce un valor entero = "); scanf(" %lld", &N); printf("Introduce un valor (0-9) = "); scanf(" %hd", &d); i = 0; b = 0; while(N > 0) { cifra = N%10; if (cifra == d) { i = 1; b++; } N = N/10; } if(i == 1) printf("\nEl numero contiene la cifra (%hd) %hd veces.\n", d, b); else printf("\nEl numero no contiene la cifra (%hd).\n", d); return 0; }
gcc
1231 5
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 0.25 sec, absolute running time: 0.15 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0.41 sec
edit mode
|
history
|
discussion
Introduce un valor entero = Introduce un valor (0-9) = El numero no contiene la cifra (5).