GeekInterview
|
Geeks Forum
|
Online Quiz
|
Learning Center
|
Privacy
|
Terms and Conditions
|
Contact
Home
>
Code Samples
>
C/C++
> Adam Number
Adam Number
Description:
To check whether a number is adam number or not
Date added:
16 September, 2007
Submitted By:
Priya
Rating:
0
Download:
N/A
Instructions:
To check whether a number is adam number or not
Source Code:
/* To check whether a number is adam number or not */ #include #include void main() { int i,n,n1,n2,ns,r,rev=0,nr=0,nrs; clrscr(); printf("Enter a no.n"); scanf("%d",&n); ns=n; n1=n*n; n2=n1; while(n2>0) { r=n2%10; n2=n2/10; rev=rev*10+r; } while(ns>0) { r=ns%10; ns=ns/10; nr=nr*10+r; } nrs=nr*nr; if (rev==nrs) printf("%d is an adam no.n",n); else printf("%d is not an adam no.n",n); getch(); }
WidgetBucks - Trend Watch - WidgetBucks.com
Comments
[
Leave Comment
]
Your name:
E-mail (optional):
Text:
Please enter code
shown on image:
No comments posted yet. Be the first one to comment.
Tips
[
Leave Tip
]
Your name:
E-mail (optional):
Text:
Please enter code
shown on image:
No tips added yet. Be the first one to share tip.
Reviews
[
Leave Review
]
Your name:
E-mail (optional):
Rate:
1
2
3
4
5
6
7
8
9
10
Text:
Please enter code
shown on image:
No reviews added yet. Be the first one to review.
Tags
code
Related Categories
MYSQL » Database » C/C++
SQL Server » Database » C/C++
DB2 » Database » C/C++
Code Samples » C/C++
Oracle » Database » C/C++
Copyright @
GeekInterview.com