Thread: flip

  1. #16
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    I dont believe it cuts off the first digit.

  2. #17
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >It cuts off the first digit.
    Hence the first printf call.
    My best code is written with the delete key.

  3. #18
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Doh, didn't see the mod on the first printf.

    Ok it doesn't work because of neg numbers, yeah I can save this

  4. #19
    Registered User
    Join Date
    Jun 2003
    Posts
    51

    Talking

    Code:
    int n=12345,c=10,a=0;
    while(n%c!=n*10)
    {
    	a=n%c;
    	printf("%d",a / (c/10));
    	n-=a;
    	c*=10;
    }
    Last edited by megablue; 09-10-2004 at 06:08 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Does memcpy cause endian flip?
    By Subsonics in forum C Programming
    Replies: 7
    Last Post: 01-17-2009, 06:30 PM
  2. code doesnt flip array
    By noob2c in forum C Programming
    Replies: 3
    Last Post: 03-29-2003, 09:54 AM
  3. Need help on flip array algorithm
    By DiepVien_007 in forum C Programming
    Replies: 4
    Last Post: 03-17-2003, 04:59 PM
  4. C++ algorithm help
    By Gene126 in forum C++ Programming
    Replies: 8
    Last Post: 10-10-2002, 03:17 PM
  5. flip
    By Unregistered in forum C Programming
    Replies: 7
    Last Post: 07-18-2002, 08:20 AM