Problem showing Moduls ...

This is a discussion on Problem showing Moduls ... within the C Programming forums, part of the General Programming Boards category; There is a logical error in the program line ie. printf("\nThe remander is : %d ",b); it does not show ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    12

    Problem showing Moduls ...

    There is a logical error in the program line ie.
    printf("\nThe remander is : %d ",b);
    it does not show the Moduls of the number .Suppose i write the number 5 i.e 15%10 it have to show 5 but on the screen it shows
    the line as mention above.Please tell me what is the logical error that it shoes the out put as
    printf("\nThe remander is : %d ",b);
    Remaining my program is working fine.

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int a,b,c;
    clrscr();
    printf("Enter the number : ");
    scanf("%d",&a);

    c=a/10;
    b=a%10;
    printf("The answer is : %d ",c);
    printf("\nThe remander is : %d ",b); .....Error is here...?

    getch();
    }

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    UK
    Posts
    169
    Just tried the program an I got this output ! If this is correct then there's not a problem with the code.

    Enter the number : 15
    The answer is : 1
    The remander is : 5

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  2. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM
  3. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  4. New problem (tictactoe)
    By Mech0z in forum Game Programming
    Replies: 0
    Last Post: 02-03-2006, 05:19 AM
  5. Problem with Dialog not showing
    By face_master in forum Windows Programming
    Replies: 12
    Last Post: 12-29-2002, 09:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21