5.
a) What are the commonly used input functions in ‘C’? Write their syntax and explain the purpose of each.
b) Develop a flowchart and then write a program to compute the roots of a quadratic equation A*X^2 + B*X + C = 0. Allow the possibility that (B^2 – 4*A*C) <= 0.
a) What are the commonly used input functions in ‘C’? Write their syntax and explain the purpose of each.
b) Develop a flowchart and then write a program to compute the roots of a quadratic equation A*X^2 + B*X + C = 0. Allow the possibility that (B^2 – 4*A*C) <= 0.
(6+9)
6.
a) What are logical, syntactic and execution errors? Give examples of each. Which is most difficult to find and why?
b) Enumerate features of a good ‘C’ program. Describe the commonly used techniques as to how ‘C’ programs can be made highly readable and modifiable.
c) What is an algorithm? Develop an algorithm to test whether a given number is a prime number.
a) What are logical, syntactic and execution errors? Give examples of each. Which is most difficult to find and why?
b) Enumerate features of a good ‘C’ program. Describe the commonly used techniques as to how ‘C’ programs can be made highly readable and modifiable.
c) What is an algorithm? Develop an algorithm to test whether a given number is a prime number.
(5+5+5)
7.
a) Develop loops using
i) While statement
ii) Do-while statement
iii) For statement
that will calculate the sum of every third integer, beginning with k=2 for all values of k <= 100.
a) Develop loops using
i) While statement
ii) Do-while statement
iii) For statement
that will calculate the sum of every third integer, beginning with k=2 for all values of k <= 100.
b) Write a function that will compute
Y = X^n
Where Y and X are floating point numbers and n is an integer number. Use this function and print the output
X n Y
... ... ...
Check for possible exceptions that may occur during computations with regard to the magnitude of computed values.
Y = X^n
Where Y and X are floating point numbers and n is an integer number. Use this function and print the output
X n Y
... ... ...
Check for possible exceptions that may occur during computations with regard to the magnitude of computed values.
(6+9)
8.
a) How does an array differ from a structure? Give and explain the syntax of array and structure as defined in ‘C’.
b) How are one-dimensional and two-dimensional arrays stored in computer memory? Illustrate with an example.
c) Develop a program to multiply two matrices with sizes 3x4 and 4x5. Your program should take care of the fact that no element of either matrix can be negative. Include appropriate documentation.
a) Give the main advantage of storing data as a file. Describe various ways in which data files can be categorized in ‘C’. Illustrate by examples.
b) What is an indirection operator? Explain its usage to access a multidimensional array element. Illustrate your answer by an example.
c) ‘C’ compiler supports many pre-processor commands. Write their names only.
a) How does an array differ from a structure? Give and explain the syntax of array and structure as defined in ‘C’.
b) How are one-dimensional and two-dimensional arrays stored in computer memory? Illustrate with an example.
c) Develop a program to multiply two matrices with sizes 3x4 and 4x5. Your program should take care of the fact that no element of either matrix can be negative. Include appropriate documentation.
(6+2+7)
9.a) Give the main advantage of storing data as a file. Describe various ways in which data files can be categorized in ‘C’. Illustrate by examples.
b) What is an indirection operator? Explain its usage to access a multidimensional array element. Illustrate your answer by an example.
c) ‘C’ compiler supports many pre-processor commands. Write their names only.
(6+6+3)
No comments:
Post a Comment