Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
3. C program to find sum of first and last digit of a number
Zahidx
Jun 22nd, 2019
51
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
C
0.18 KB
| None
|
0
0
raw
download
clone
embed
print
report
#include<stdio.h>
int
main
(
)
{
int
sum
=
0
,
n
,
fd
,
ld
;
scanf
(
"%d"
,&
n
)
;
ld
=
n
%
10
;
while
(
n
>=
10
)
{
n
=
n
/
10
;
}
fd
=
n
;
sum
=
fd
+
ld
;
printf
(
"first and last digit sum=%d"
,
sum
)
;
return
0
;
}
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
JSON | 13 min ago | 2.80 KB
pastebin.ai - #1 pastebin.com alternative
PHP | 13 min ago | 0.83 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 14 min ago | 0.39 KB
Item Pick Up
Lua | 16 min ago | 1.39 KB
How to find the palette number of a color in...
JavaScript | 47 min ago | 0.53 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🎁
GetText | 56 min ago | 0.38 KB
Untitled
C++ | 1 hour ago | 1.25 KB
Kid Punishment
Lua | 1 hour ago | 0.86 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!