2 Replies - 188 Views - Last Post: 11 December 2012 - 06:23 PM Rate Topic: -----

#1 jayveeeeeee  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 66
  • Joined: 27-September 12

help me for reverse number

Posted 11 December 2012 - 08:47 AM

can anyone can help just gave me an idea how to reverse it ,,please tell me what is the problem on my code


;int i=0; int result = 0; int num=0; printf("enter number"); for(i=0; i<base; i++) scanf("%d", &a[i]); do {  result *= a[i];  result += num % a[i];  } while( num /= a[i]); return( result );  printf("reverse is %d" , result); getch(); } ']



#include<stdio.h>
#include<conio.h>
main()
{
const int base=10;
int a[base];int i=0;
int result = 0; int num=0;
printf("enter number");
for(i=0; i<base; i++)
scanf("%d", &a[i]);
do
{

result *= a[i];

result += num % a[i];

} while( num /= a[i]);
return( result );

printf("reverse is %d" , result);
getch();
}

This post has been edited by no2pencil: 11 December 2012 - 08:48 AM
Reason for edit:: Added Code Tags


Is This A Good Question/Topic? 0
  • +

Replies To: help me for reverse number

#2 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5224
  • View blog
  • Posts: 26,991
  • Joined: 10-May 07

Re: help me for reverse number

Posted 11 December 2012 - 08:47 AM

If you can't take a minute or two to properly prepare a post asking for help so that it is legible code, what incentive do we have to help you?
Was This Post Helpful? 0
  • +
  • -

#3 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1072
  • View blog
  • Posts: 4,532
  • Joined: 09-June 09

Re: help me for reverse number

Posted 11 December 2012 - 06:23 PM

;int i=0; int result = 0; int num=0; printf("enter number"); for(i=0; i<base; i++) scanf("%d", &a[i]); do {  result *= a[i];  result += num % a[i];  } while( num /= a[i]); return( result );  printf("reverse is %d" , result); getch(); } ']



Are you serious? :crazy:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1