Assignment No 1

1
Nihar Ranjan Roy [email protected] COMPUTER PROGRAMMING & PROBLEM SOLVING (CSE-101) ASSIGNMENT NO -1 FALL, 2011 1. Explain the different components of a computer with block diagram. 2. What is an operating system? What is its work? 3. What are the different types of Operating systems available in the market today? 4. Differentiate between a. Compiler and interpreter b. Assembler and compiler 5. What do you mean by an algorithm? What are the two criteria’s on the basis of which an algorithm is evaluated. 6. Design an algorithm for finding the sum of the square of first n numbers of the series ൌ ሺ ୀଵ Where a 1 =1.and a i+1 = a i +2. 7. The harmonic mean defined by H ܪ 1 ୀଵ is sometimes used as mean of central tendency. Develop an algorithm to compute the harmonic mean of n data values. 8. Develop an algorithm to compute the first n (where n>=0) terms of the following series S=1-3+5-7+9 9. Design an algorithm that converts binary numbers to octal. 10. Write an algorithm to evaluate the following functions to 0.0001% accuracy ....... 7! 5! 3! - X sin x x x x 7 5 3 + + = 11. Write algorithm, source code in C and flow chart for the following a. Fibonacci sequence, upto n th term. b. Reversing the digits of an integer c. Checking whether the given number is a prime number or not d. Finding the sum of the digits of a number. ~~o~~

description

Programming in C

Transcript of Assignment No 1

  • Nihar Ranjan Roy [email protected]

    COMPUTER PROGRAMMING & PROBLEM SOLVING (CSE-101)

    ASSIGNMENT NO -1 FALL, 2011

    1. Explain the different components of a computer with block diagram. 2. What is an operating system? What is its work? 3. What are the different types of Operating systems available in the market today? 4. Differentiate between

    a. Compiler and interpreter b. Assembler and compiler

    5. What do you mean by an algorithm? What are the two criterias on the basis of which an algorithm is evaluated.

    6. Design an algorithm for finding the sum of the square of first n numbers of the series

    Where a1=1.and ai+1= ai +2. 7. The harmonic mean defined by H

    1

    is sometimes used as mean of central tendency. Develop an algorithm to compute the harmonic mean of n data values.

    8. Develop an algorithm to compute the first n (where n>=0) terms of the following series

    S=1-3+5-7+9 9. Design an algorithm that converts binary numbers to octal. 10. Write an algorithm to evaluate the following functions to 0.0001% accuracy

    .......7!5!3!

    -Xsin x xxx753

    ++= 11. Write algorithm, source code in C and flow chart for the following

    a. Fibonacci sequence, upto nth term. b. Reversing the digits of an integer c. Checking whether the given number is a prime number or not d. Finding the sum of the digits of a number.

    ~~o~~