Thread: removing a part from a number

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    11

    removing a part from a number

    have to write code that lets the user enter a 5 digit's number.
    after that it must remove the 3th digit from the number and printf the rest of the number
    this is what i written but it's not good , because it ask for evry digit individually .

    Code:
    #include <stdio.h>
    #include <conio.h>
    void main()
    {
    clrscr();
    int a,b,c,d,e;
    printf("Enter 5 digits number:\n");
    scanf("&#37;d%d%d%d%d",&a,&b,&c,&d,&e);
    printf("After removing the 3th digit the number is:\n%d%d%d%d",a,b,d,e);
    getch();
    }
    Last edited by samsung; 10-24-2007 at 03:31 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting part of a number
    By h3ro in forum C++ Programming
    Replies: 3
    Last Post: 03-16-2009, 12:44 PM
  2. Stone Age Rumble
    By KONI in forum Contests Board
    Replies: 30
    Last Post: 04-02-2007, 09:53 PM
  3. Replies: 2
    Last Post: 11-18-2006, 03:31 AM
  4. Perfect number...
    By Argo_Jeude in forum C++ Programming
    Replies: 8
    Last Post: 07-12-2005, 01:53 PM