Code Monkey home page Code Monkey logo

c-assignments's Introduction

Database of C Assignments

Assignment 1 - 15.11.2022 by Ms Pooja Shrivastav
  1. Write a C program to input Principal, Rate and Time and calculate Simple Interest.
  2. Write a C program to input temperature in Fahrenheit and convert it to Celsius.
  3. Write a C program to input time in seconds and convert it to hours, minutes and remaining seconds.
  4. Write a C program to calculate area and circumference of a circle using pre-processor directive.
  5. Write a C program to find out if input character is a digit, alphabet or special symbol.
  6. Write a C program to find out if input alphabet is a vowel or not.
  7. Write a program to find largest and second largest of 3 numbers using Nested if statement.
  8. 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
  1. Taking an input N from the user, print all the even numbers in descending order up to zero.
  2. Write a program to calculate the difference of the sum of all odd numbers upto N and all even Numbers upto N.
  3. 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.
  4. Find the value of a%b (taking the values of and b from the user), without using the '%' operator.
  5. Write a program to find if a given number is prime or not.
Assignment 3 - 21.11.2022 by Ms Pooja Shrivastav
  1. Write a program to find GCD and LCM of two numbers.
  2. Write a menu driven program to perform different arithmetic operations.
  3. Input a number and find if it is an Armstrong number or not.
  4. Find the largest and smallest digit of a number.
  5. Print the pattern
1 2 3 4
1 2 3
1 2
1
  1. Find the sum of the series 1 + x + x^2+ x^3+ .. + x^n
  2. Find sum of series 1 + 1/2 + 1/3 + 1/4 + .. + 1/n
  3. Find Largest and Second Largest element in an array.
  4. Sort a list of N numbers using Bubble sort technique.
  5. Find if a given matrix is Identity Matrix or not.
Basic C Programs - 12.12.2022 by Ms. Moumita Roy
  1. Write a c program to print Fibonacci series without using recursion and using recursion.
  2. Write a c program to check prime number.
  3. Write a c program to check palindrome number.
  4. Write a c program to print factorial of a number.
  5. Write a c program to check Armstrong number.
  6. Write a c program to print sum of digits.
  7. Write a c program to reverse given number.
  8. Write a c program to swap two numbers without using third variable.
  9. Write a c program to print multiplication of 2 matrices.
  10. Write a c program to convert decimal number to binary.
  11. Write a c program to print alphabet triangle and number triangle.
    A             1
   ABA           212
  ABCBA         32123
 ABCDCBA       4321234
ABCDEDCBA     543212345
  1. Write a c program to convert number in characters.
DS Assignment 1 - 13.12.2022 by Ms K Komala Devi
  1. Write a C program to implement Stack and its Operations using an Array.
  2. Write a C program to read your name and display the same.
  3. List an Applications of Stack.
Algorithms 1 - 11.01.2023 by Ms. Moumita Roy
  1. 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.
  2. 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.
  3. If the ages of Ram, Shyam and Ajay are input through the keyboard, write a program to determine the youngest of the three.
  4. 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.
  5. 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.
  6. 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
  1. Write a program for a matchstick game being played between the computer and a user. Your program should ensure that the computer always wins.
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.
  1. 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.
  2. 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 )
  3. Write a program to add first seven terms of the following series using a for loop: 1/1!+2/2!+3/3!...
  4. 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.
  5. Write a program to produce the following output:
   1
  2 3
 4 5 6
7 8 9 10
  1. The natural logarithm can be approximated by the following series. ((x-1)/x) + 1/2((x-1)/x)^2 + 1/2((x-1)/x)^3 + 1/2((x-1)/x)^4 + ... If x is input through the keyboard, write a program to calculate the sum of first seven terms of this series.
Algorithms 3 - 13.01.2023 by Ms. Moumita Roy
  1. 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.
  2. 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( ).
  3. 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...
  4. 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.
  5. 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.
Sorting Algos by Moumita Mam
  1. Swap Sort
  2. Bubble / Insertion / Selection Sort
  3. Merge Sort
  4. Quick Sort
  5. Reverse Quick Sort - Taking Pivot as Last Element
  6. Topological Sort
  7. Heap Sort

Visitors Count

Loading

c-assignments's People

Contributors

noobshubham avatar nikhileshsinha avatar sumeet2442 avatar adityasagarr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.