C Solution

C Solutions

C languageC SolutionChapter 3Programming

Q22 In digital world colors are specified in Red-Green-Blue (RGB) format, with values of R, G, B varying on an interger scale from 0 to 255. In print publishing the colors are mentioned in Cyan-Magenta-Yellow-Black (CMYK) format, with values of C, M, Y, and K varying on a real scale from 0.0 to 1.0. Write a program that converts RGB color to CMYK color as per the following formulae: Note that of the RGB values are all 0, then the CMY values are all 0 and the K value is 1.

Program: 90 In digital world colors are specified in Red-Green-Blue (RGB) format, with values of R, G, B varying on

Read More
C languageC SolutionChapter 3Programming

Q20 The policy followed by a company to process customer orders is given by the following rules: (i) If order quantity is less than or equal to that in stock and his credit is ok, supply his requirement. (ii) If his credit is not ok do not supply. Send him intimation. (iii) if his credit is ok but the item in stock is less than his order, supply what is in stock. Intimation him that balance will be shipped later. Write a C program to implement the company policy.

Program: 88 The policy followed by a company to process customer orders is given by the following rules: (i) If

Read More
C languageC SolutionChapter 3Programming

Q19 In a company, worker efficiency is determined on the basis of time required for a worker to complete a particular job. If time taken by the worker is between 2-3 hours, then the worker is said to be highly efficient. If time required by the worker is between 3-4 hours, then the worker is ordered to improve speed. If time taken is between 4-5 hours, the worker is given training to improve his speed, and if time taken by the worker is more than 5 hours, then the worker is terminated. If the time taken by the worker is input through the keyboard, write a program to find the efficiency of the worker.

Program: 87 In a company, worker efficiency is determined on the basis of time required for a worker to complete

Read More
C languageC SolutionChapter 3Programming

Q16 A library charges a fine for every book returned late. For first 5 days the fine is 50 paise per day, for 6-10 days fine is one rupee per day and above 10 days fine is 5 rupees per day. If you return the book after 30 days your membership will be cancelled. Write a program to accept the number of days the member is late to return the book and display the fine appropriate message.

Program: 84 A library charges a fine for every book returned late. For first 5 days the fine is 50

Read More
C languageC SolutionChapter 3Programming

Q15 A certain grade of steel is graded according to the following conditions: (i) Hardness must be greater than 50 (ii) Carbon content must be less than 0.7 (iii) Tensile strength must be greater than 5600 The grades are as follows: Grade is 10 if all three conditions are met Grade is 9 if conditions (i) and (ii) are met Grade is 8 if conditions (ii) and (iii) are met Grade is 7 if conditions (i) and (iii) are met Grade is 6 if and only one conditions is met Grade is 5 is none of the conditions are met Write a program, which will require the user to give value of hardness, carbon content and tensile strength of the steel under consideration and output the grade of the steel.

Program: 83 A certain grade of steel is graded according to the following conditions: Hardness must be greater than 50

Read More
C languageC SolutionChapter 3Programming

Q14 Any character is entered through the keyboard, write a program to determine whether the character entered is a capital letter, a small case letter, a digit or a special symbol. The Following table shows the range of ASCII values for various characters.

Program: 82 Any character is entered through the keyboard, write a program to determine whether the character entered is a

Read More