Programs

A Programs written in any language like c, c++, java, html, css, python and so on.

C languageC SolutionChapter 5Programming

Q2. Write a program to find the grace marks for a student using switch. The user should enter the class obtained by the student and the number of students he has failed in. Use the following logic: – If the student gets first class and the number of subjects he failed in is greater than 3, then he does not get any grace. Otherwise the grace is of 5 marks per subject. – If the student gets second class and the number of subjects he failed in is greater than 2, then he does not get any grace. Otherwise the grace is of 4 marks per subject. – If the student gets third class and the number of subjects he failed in is greater than 1, then he does not get any grace. Otherwise the grace is of 5 marks.

Program: 121 Write a c program to find the grace marks for a student using switch. The user should enter

Read More
C languageC SolutionChapter 5Programming

Q1 Write a menu driven program which has following options: 1. Factorial of a number 2. Prime or not 3. Odd or even 4. Exit Once a menu item is selected the appropriate action should be taken and once this action is finished, the menu should reappear. Unless the user selects the ‘Exit’ option the program should continue to run.

Program: 120 Write a menu driven c program which has following options: Factorial of a number Prime or not Odd

Read More
C languageC SolutionChapter 4Programming

Q19 According to a study, the approximate level of intelligence of a person can be calculated using the following formula: i=2+(y+0.5x) Write a program that will produce a table of values of i, y and x, where y varies from 1 to 6, and, for each value of y, x varies from 5.5 to 12.5 in steps of 0.5.

Program:112 According to a study, the approximate level of intelligence of a person can be calculated using the following formula:

Read More