Code.GeekInterview.com
 
Code Samples C
 

Program to find out an adam number using arrays


Code ResourceAuthor: venkatakrishnansvpr  

Difficulty Level: Beginner

Published: 18th May 2010   Read: 7081 times  

Filed in: C
Add Comment


 

 

Sponsored Links


 

 

Program to find out an adam number using the concept of arrays

 


Sample Code
  1. /*program to find out an adam number..using the concept of arrays */
  2. #include<stdio.h>
  3. #include<conio.h>
  4. #include<math.h>
  5. main()
  6. {
  7. clrscr();
  8. printf(" created by ....a a venkat ");
  9. int i,a[100],b[100],num=0,sq;
  10. int j,mod,sq2,n,rev,num2=0,revsq;
  11. printf("nenter the number of digits going to be entered");
  12. scanf("%d",&n);
  13. printf("nEnter the number in digits one by one..");
  14. for( i=0;i=0;i++,j--)
  15. {
  16. b[i]=a[j];
  17. }
  18. for( i=0;i0)
  19. {
  20. mod=sq2%10;
  21. revsq=revsq*10+mod;
  22. sq2=sq2/10;
  23. }
  24. printf("%d",revsq);
  25. if(sq==revsq)
  26. {
  27. printf("nadam number");
  28. }
  29. else
  30. {
  31. printf("nnot adam number");
  32. }
  33. getch();
  34. }
Copyright GeekInterview.com


Next Article: Dichotomous Search Method


 

Latest Code Samples

 

Popular Code Samples

 

Related Code Samples

 

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    



Popular Coders

# Coder NameHits
1. kaivalya198933968
2. mano.mithun21652
3. deepu0817876
4. meefriend4ever8124
5. chandrikakr8092
6. sadasivathavamani7363
7. shashivaishnav7162
8. venkatakrishnansvpr7082
9. Jimmy Zorald6713
10. sripri5712

Active Coders

Refined Tags