Code Monkey home page Code Monkey logo

computer_assignment's Introduction

Computer_Assignment

Files are named as (Question Number)_(Assignment Number).
Folders will be created as Assignment numbers increase.
You are free to fork the repository and make improvements to the code or suggest changes.
-DC

Assignmnet 1

  1. Write a program to print the words hello, world.
  2. Write a program to accept the Fahrenheit temperature from keyboard and print its equivalent Celsius value.
  3. Write a program to accept N different numbers from keyboard and print the numbers.
  4. Write a program to accept N different numbers from keyboard and print the sum of those numbers.

Assignment 2

Couldn't find questions

Assignment 3

  1. Write a C program to print your name ‘n’ times where n is a user given input.
  2. Write a C program to find if a number is odd or even.
  3. Write a C program to find the largest among three numbers.
  4. Write a C program to enter elements in an array of size 10 and print the array.
  5. Write a C program to swap two numbers. The numbers are taken as input from the user.
  6. Write a C program to compute quotient and remainder using two functions.

Assignment 4

  1. Write a C program to compute the area and circumference of a circle for a given radius, r. Here radius r has to be taken from the user.
  2. Write a C program for temperature conversion.
    • Convert the equivalent temperature in Fahrenheit (f) to Celsius (c), where f has to be taken from the keyboard
    • Convert the equivalent temperature in Celsius (c) to Fahrenheit (f), where c has to be taken from the keyboard
  3. Write C program to evaluate the following expressions
    • 4x2+2x+10
    • 5x3+4x2y2+4y3+30 Here x and y may be integer/float quantity have to be taken from the keyboard.
  4. Write a C program that prints the next character from the ASCII table for the corresponding character taken from the keyboard. As for example, if the character taken from the keyboard is ‘B’, the program will print the immediate next character ‘Ç’. Also print the corresponding ASCII value.

Assignment 5

  1. Write a C program to find the sum of individual digits of a positive integer. The number has to be taken as input from the keyboard. The total number of digits in the number may be four.
  2. Write a C program to find roots of a quadratic equation where the coefficients are entered by the user.
  3. Write a C program to check whether a given year entered from the keyboard is a leap year or not.
  4. Write a C program that takes as input a single character from the user and check whether the entered character is a vowel or consonant.
  5. Write a C program that takes as input a single character from the user. If the character is an English alphabet in small case, it is converted to upper case and printed out. If the character is an English alphabet in upper case, it is converted to lower case and printed out. If the character is not an English alphabet in small case, then it is kept unchanged and printed out.

Assignment 6

  1. Write a C program that takes an integer as input from the keyboard and display it in words. As for example, if the integer is 235, the output will be Two Three Five.
  2. Write a C program to generate set of all prime numbers between 1 and n, where the number n has to be supplied by the user.
  3. Write a C program that takes two integer numbers (say x and y) and prints the value xy. Do not use the standard library function pow() for the computation of xy.
  4. Write a C program to find the GCD of two given numbers.
  5. Write a C program to find the sum of the following series up to nth term, where x or n have to be taken from the user. Do not use the standard library function pow() for the computation of xn.
    • 1+2+3+4+….up to nth terms
    • 1+x+x2+x3+….up to nth terms
    • S = 1+x+x2/2!+x3/3!+….up to nth terms
    • S = 1-2+3-4+….up to nth terms
    • S = 2+4+6+….up to nth terms

Assignment 7

  1. Write a C program to generate Fibonacci sequence up to nth term where n is an input have to be taken from the keyboard. Write a main program to test it. The Fibonacci numbers are generated by setting F0=0, F1=1 and using the following formula to get the rest. Fn = Fn-1+Fn-2
  2. Write a C program to compute the sum of the numbers between 20 to 30 and divisible by 2 and 3.
  3. Write a C program to check whether an input integer is power of two or not. As for example, 23 = 8.
  4. Write a C program to print the following pattern for n number of rows, here n is an input taken from keyboard, use loops and use ASCII code where ever needed.
    • *
      * *
      * * *
      * * * *
      
    • 0
      1 2
      3 4 5
      6 7 8 9
      
    • 1
      2 3 4
      5 6 7 8 9
      
    • A
      B C
      D E F
      G H I J
      

Assignment 8

  1. Write a C program to store a list of integers in an array and print the following:
    • The maximum value present in the array
    • The minimum value present in the array
    • The average value of all the elements in the array
    • Find the sum of odd numbers from the array
    • Print the array contents in reverse
  2. Write a C program to search a data-item in the array, if it exists in the array, print the corresponding index.
  3. Write a C program that can sort n numbers stored in a one dimensional array in ascending order. Here n and list of numbers are user input.
  4. Write a C program that can copy the list of data item from one array to another array.
  5. Write a C program that can print the binary equivalent of a decimal integer. Here decimal integer is a user input.

Assignment 9

  1. Write a C program that can compare two input strings without using strcmp().
  2. Write a C program that takes a string as input and then prints the number of occurrence(s) of each vowel of the English alphabets in the string.
  3. Write a C program to check whether an input string is palindrome or not.
  4. Write a C program to display the size of every data type using “sizeof” operator.
  5. Write a C program to compute grade of n students in a subject. The grades are assigned as follow:
Marks Grade
marks<50 F
50≤marks<60 C
60≤marks<70 B
70≤marks<80 B+
80≤marks<90 A
90≤marks<100 A+
  1. Write a C program to determine whether the input character is capital or small letter, digits or special symbol.
  2. Write a C program to check whether a date is valid or not.

Assignment 10

  1. Write suitable function and corresponding program to test them for the following:
    • Compute Xn, where X is any valid number and n is an integer value
    • Swap values of two integer variables without using temporary variable.
    • Compute the GCD of two integers and return the result to the calling function.
    • Compute and return the sum of n elements of an integer array.
    • Remove white spaces (blank spaces) from a string.
  2. Write a C function reverse(s) to reverse the string s, where s is an argument in the function reverse(s).
  3. Write a C function subs(s1, s2) which returns 1 if s2 is a substring of s1 otherwise 0.
  4. Write a C function that takes input a two dimensional array of integers, find the largest integer among them, return it to calling function.
  5. Write a C function that takes input a two dimensional array of integers, find the largest number from each row and column individually, store it in two corresponding one dimensional array respectively and display it. Write the complete program to test the function.

Assignment 11

  1. Write a C function “ïntreverseInteger(int n)”, that returns the reverse of n, that is the returned integer (in decimal) contains the same decimal digits as n, but in reverse order. Write a complete C program to test the function.
  2. Write a C function “intstringLength(char src[])” that finds and returns the length of the null terminated string src[], that is, the number of characters (excluding the null character) in the parameter src[].
  3. Write a C function that takes a decimal number and base as argument and returns the equivalent number of the given base.
  4. Write a C function to reverse every word of a given string. As, for example, if the input string is ‘C Programming Class’ output string will be ‘C gnimmargorP ssalC’.
  5. Write a program to calculate sum of first 20 natural numbers using recursive function.

Assignment 12

  1. Write a program to find the sum of all the elements of an array using pointers.
  2. Write a program to swap value of two variables using pointer.
  3. Write a program to copy one array to another using pointer.
  4. Write a program to swap two arrays using pointers.
  5. Write a program to reverse an array using pointers.
  6. Write a program to find length of string using pointers.
  7. Write a program to copy one string to another using pointer.
  8. Write a program to concatenate two strings using pointers.
  9. Write a program to compare two strings using pointers.

Assignment 13

  1. Declare a structure for storing complex numbers. Write a C program that performs the following operations.
    • Read two complex numbers (a+ib)
    • Add two complex numbers
    • Subtract two complex numbers
    • Multiply two complex numbers
  2. Declare a structure to store the following information of an employee.
    • Employee code
    • Employee name
    • Salary
    • Department number
    • Date of joining (it is itself a structure consisting of day, month, year) Write a program that can take above information of 10 employees and display information for those employees whose salary ≥10000.
  3. Write a C program to copy one existing file (source file, say file1.txt) into another file (destination file, say file2.txt). In this case take the filename as input through command line argument. As for example, $./a.out file1.txt file2.txt
  4. Write a C program that can compare two files specified by the user, return a nonzero value if identical otherwise zero. (such as $cmp file1.txt file2.txt; compare the content of file1.txt and file2.txt if identical display 1 otherwise 0.)
  5. Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 20 students in the collage.
    • Write a function to print names of all students who joined in a particular year.
    • Write a function to print the data of a student whose roll number is given.
  6. Create a structure to specify data of customers in a bank. The data to be stored is: Account number, Name, Balance in account. Assume maximum of 20 customers in the bank.
    • Write a function to print the Account number and name of each customer with balance below Rs. 100.
    • If a customer request for withdrawal or deposit, it is given in the form: Acct. no, amount, code (1 for deposit, 0 for withdrawal) Write a program to give a message, “The balance is insufficient for the specified withdrawal”.

Assignment 14

  1. Write a C program to read a file and display contents with its line numbers.
  2. Write a C program to find the size of a text file.
  3. Write a C program to add the contents of one file at the end of another.
  4. The file student_rec contains name and age of 10 students. Write a C program to read these records and display them in sorted order by name.
  5. Implement the Selection Sort and Bubble Sort algorithms to sort an array having 10 elements.
  6. 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.
  7. Write a program to sort a set of names stored in an array in alphabetical order.

computer_assignment's People

Contributors

01-dc avatar jatin-1956 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

computer_assignment's Issues

Q3

When running the program Q3_A1.c

printf("Give input number: "); should be included outside of the while loop and it's also worth mentioning users to input the numbers after a space rather than using new line (pressing enter key) otherwise the output will be just a repetition.

https://github.com/01-DC/Computer_Assignment/blob/main/Q3_A1.c

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.