Assignment 1 - 15.11.2022 by Ms Pooja Shrivastav
- Write a C program to input Principal, Rate and Time and calculate Simple Interest.
- Write a C program to input temperature in Fahrenheit and convert it to Celsius.
- Write a C program to input time in seconds and convert it to hours, minutes and remaining seconds.
- Write a C program to calculate area and circumference of a circle using pre-processor directive.
- Write a C program to find out if input character is a digit, alphabet or special symbol.
- Write a C program to find out if input alphabet is a vowel or not.
- Write a program to find largest and second largest of 3 numbers using Nested if statement.
- Write a program to input marks of three subjects for a student. Calculate percentage and find his result (First class/ Second class/ Third class/ Fail) using if-else statement.
Assignment 2 - 17.11.2022 by Ms Pooja Shrivastav
- Taking an input N from the user, print all the even numbers in descending order up to zero.
- Write a program to calculate the difference of the sum of all odd numbers upto N and all even Numbers upto N.
- Take 4 number from the user a,b,c,d and then find the value of (a^b)/(c^d). You should not use pow() function.
- Find the value of a%b (taking the values of and b from the user), without using the '%' operator.
- Write a program to find if a given number is prime or not.
Assignment 3 - 21.11.2022 by Ms Pooja Shrivastav
- Write a program to find GCD and LCM of two numbers.
- Write a menu driven program to perform different arithmetic operations.
- Input a number and find if it is an Armstrong number or not.
- Find the largest and smallest digit of a number.
- Print the pattern
1 2 3 4
1 2 3
1 2
1
Basic C Programs - 12.12.2022 by Ms. Moumita Roy
- Write a c program to print Fibonacci series without using recursion and using recursion.
- Write a c program to check prime number.
- Write a c program to check palindrome number.
- Write a c program to print factorial of a number.
- Write a c program to check Armstrong number.
- Write a c program to print sum of digits.
- Write a c program to reverse given number.
- Write a c program to swap two numbers without using third variable.
- Write a c program to print multiplication of 2 matrices.
- Write a c program to convert decimal number to binary.
- Write a c program to print alphabet triangle and number triangle.
A 1
ABA 212
ABCBA 32123
ABCDCBA 4321234
ABCDEDCBA 543212345
DS Assignment 1 - 13.12.2022 by Ms K Komala Devi
Algorithms 1 - 11.01.2023 by Ms. Moumita Roy
- According to the Gregorian calendar, it was Monday on the date 01/01/1900. If any year is input through the keyboard write a program to find out what is the day on 1st January of this year.
- A five-digit number is entered through the keyboard. Write a program to obtain the reversed number and to determine whether the original and reversed numbers are equal or not.
- If the ages of Ram, Shyam and Ajay are input through the keyboard, write a program to determine the youngest of the three.
- An Insurance company follows following rules to calculate premium. (1) If a person’s health is excellent and the person is between 25 and 35 years of age and lives in a city and is a male then the premium is Rs. 4 per thousand and his policy amount cannot exceed Rs. 2 lakhs. (2) If a person satisfies all the above conditions except that the sex is female then the premium is Rs. 3 per thousand and her policy amount cannot exceed Rs. 1 lakh. (3) If a person’s health is poor and the person is between 25 and 35 years of age and lives in a village and is a male then the premium is Rs. 6 per thousand and his policy cannot exceed Rs. 10,000. (4) In all other cases the person is not insured. Write a program to output whether the person should be insured or not, his/her premium rate and maximum amount for which he/she can be insured.
- A library charges a fine for every book returned late. For first 5 days the fine is 50 paise, for 6-10 days fine is one rupee and above 10 days fine is 5 rupees. 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 or the appropriate message.
- Write a program using conditional operators to determine whether a year entered through the keyboard is a leap year or not.
Algorithms 2 - 11.01.2023 by Ms. Moumita Roy
Rules for the game are as follows:
- There are 21 matchsticks.
- The computer asks the player to pick 1, 2, 3, or 4 matchsticks.
- After the person picks, the computer does its picking.
- Whoever is forced to pick up the last matchstick loses the game.
- Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered.
- Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number. For example,
153 = ( 1 * 1 * 1 ) + ( 5 * 5 * 5 ) + ( 3 * 3 * 3 )
- Write a program to add first seven terms of the following series using a for loop:
1/1!+2/2!+3/3!...
- According to a study, the approximate level of intelligence of a person can be calculated using the following formula:
i = 2 + ( y + 0.5 x )
. Write a program, which 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. - Write a program to produce the following output:
1
2 3
4 5 6
7 8 9 10
Algorithms 3 - 13.01.2023 by Ms. Moumita Roy
- A positive integer is entered through the keyboard. Write a function to obtain the prime factors of this number. For example, prime factors of 24 are 2, 2, 2 and 3, whereas prime factors of 35 are 5 and 7.
- Write a function that receives marks received by a student in 3 subjects and returns the average and percentage of these marks. Call this function from main( ) and print the results in main( ).
- Write a recursive function to obtain the first 25 numbers of a Fibonacci sequence. In a Fibonacci sequence the sum of two successive terms gives the third term. Following are the first few terms of the Fibonacci sequence: 1 1 2 3 5 8 13 21 34 55 89...
- Given three variables x, y, z; write a function to circularly shift their values to right. In other words, if x = 5, y = 8, z = 10 after circular shift y = 5, z = 8, x =10 after circular shift y = 5, z = 8 and x = 10. Call the function with variables a, b, c to circularly shift values.
- For the following set of sample data, compute the standard
deviation and the mean.
-6, -12, 8, 13, 11, 6, 7, 2, -6, -9, -10, 11, 10, 9, 2
The formula for standard deviation is Square_root((xi-xm)^2)/n where xi is the data item, n is number of data items and xm is the mean.