Thread: This is my assignment. But I don't know how to use modulus here.

  1. #1
    Registered User
    Join Date
    Jun 2016
    Location
    Bangladesh
    Posts
    2

    Unhappy This is my assignment. But I don't know how to use modulus here.

    Find the value of x=(3a+2b*5c)/9%a
    Ask for entering values first. result should be print in float. Where take input from user.

  2. #2
    Registered User
    Join Date
    May 2015
    Posts
    10
    hey in c there is no meaning for modulo of non int number. are you sure they asked to print in floating point?
    and if they did is
    (3a+2b*5c)/9 int?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    Quote Originally Posted by jannatul View Post
    Find the value of x=(3a+2b*5c)/9%a
    Ask for entering values first. result should be print in float. Where take input from user.
    You start by making an effort on your own.

    Say prompting for a,b,c and then printing them out - which would at least verify that you read them correctly.

    http://cboard.cprogramming.com/c-pro...uncements.html
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Jun 2016
    Location
    Bangladesh
    Posts
    2
    yeah. I know that it is not possible to use modulus in floating point. that is why I am confused..And i am sure about the question.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. %(Modulus)
    By cuo741 in forum C Programming
    Replies: 19
    Last Post: 05-14-2010, 08:50 AM
  2. Replies: 3
    Last Post: 04-26-2009, 08:54 AM
  3. modulus
    By nicknack in forum C Programming
    Replies: 7
    Last Post: 12-15-2007, 09:45 AM
  4. Modulus algorithm
    By Magos in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 04-10-2004, 10:34 AM
  5. Help with Modulus
    By boontune in forum C++ Programming
    Replies: 4
    Last Post: 01-20-2003, 10:26 AM

Tags for this Thread