Thread: orignal number

  1. #1
    Registered User
    Join Date
    Oct 2006

    Angry orignal number

    Hi every one
    same old problem but statment changed.
    here is the code i used
    #include<stdio.h>																																																																																		 #include<stdio.h>
    int a;
    int count=0;
    int number,rem,div;
    int x=0;
    	  rem = a % 10;
    	  div = a / 10;
    	  a = div;
    	printf("%d ",rem);
    	printf("%d ",div);
    output:4 1 2 1
    required output: 1 2 1 4.
    anyone can help me out??.....

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Rishon LeZion, Israel
    use array
    first fill it with digest of the number
    when print it in the reverse order
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help getting program print out the digit in words
    By cosmiccomputing in forum C Programming
    Replies: 26
    Last Post: 04-24-2008, 08:28 AM
  2. Need help with this compiler error
    By Evangeline in forum C Programming
    Replies: 7
    Last Post: 04-05-2008, 09:27 AM
  3. Prime number program problem
    By Guti14 in forum C Programming
    Replies: 11
    Last Post: 08-06-2004, 04:25 AM
  4. parsing a number
    By juancardenas in forum C Programming
    Replies: 1
    Last Post: 02-19-2003, 01:10 PM
  5. Random Number problem in number guessing game...
    By -leech- in forum Windows Programming
    Replies: 8
    Last Post: 01-15-2002, 05:00 PM