C Online Compiler & Playground
HTML/CSS/JavaScript
HTML
CSS
Javascript
C++
C
PHP
Java
Python
Swift
C#
Ruby
Node.JS
Kotlin
jQuery
Go
R
TypeScript
Start C Course
Register
What is wrong with this code?
+1
Author: rakesh rajak
Dark
Public
Save
C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include
<
stdio.h
>
#include
<
conio.h
>
void
main
()
{
int
a
,
s
,
r
;
s
=
0
;
printf
(
"enter any number\n"
);
scanf
(
"%d"
,&
a
);
while
(
a
>
0
)
{
r
=
a
%
10
;
s
=
s
+
r
;
a
=
a
%
10
;
printf
(
"The sum of digits is %d\n"
,
s
);
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT