Академический Документы
Профессиональный Документы
Культура Документы
UNIT-I a
INTRODUCTION TO COMPUTERS
Questions
1. What is an algorithm? Write an algorithm to read five integers and find out if the values
are in ascending order.
2. Draw a flow chart to read ten integer values and print the sum of squares of the values.
3. Write an algorithm to find out if a given number is a prime.
4. Draw a flow chart to read ten positive integers and print how many are multiples of 7.
5. Write an algorithm to find out all the factors of a given positive integer.
6. Write an algorithm to read ten positive integers and find out how many are perfect
squares (such as 49, 81). You may assume that the input values read are in the range 1 to
10000.
7. List the various steps in software development.
8. Explain and specify the interactions between various components that support the basic
functionality of a computer?
9. Discuss in detail the program execution steps?
10. Define Algorithm? What are the characteristics that any algorithm should satisfy?
11. Draw a flowchart for finding maximum of given three integers?
12. Differentiate between compiler and interpreter?
13. Differentiate between application software and system software?
14. Draw a flowchart for finding the sum of n numbers starting from 1?
15. Briefly discuss various computing environments with neat diagrams?
16. List the activities involved in each phase of waterfall system development life cycle
model?
17. What are the different types of errors one can encounter during the program execution?
18. Define Psuedocode? Define flowchart? What is the use of flowchart?
19. What are the different stages in the program development?
6. Write a complete C program that reads a value in the range 1 to 12 and print the name of
that month and the next month: Print error for any other input value. (For example, print
May followed by June if the input is 5. Note that December is followed by January).
7. Write a complete C Program to read ten integers and find:
i) The number of even integers and their sum, and
(ii) The number of odd integers and their sum.
8. List the basic data types, their sizes and range of values supported by C language?
9. Describe the purpose of commonly used conversion characters in scanf() function?
10. Explain the only ternary operator available in C with illustrative example?
11. Differentiate between if-else-if ladder and switch statement?
12. What is the implicit type conversion hierarchy that is applied while evaluating
expressions?
13. What do you mean by operator precedence and associativity? How one can
override the precedence defined by C language? Give illustrative examples?
14. Explain the structure of a C program?
15. What is an identifier? What are the naming rules for identifiers in C?
16. List different categories of C operators based on their functionality? Give examples?
17. Explain different types of coding constants in a C?
18. Explain the working of Unary, Binary and Assignment Operators with example.
19. Write a 'C' program to find the squares of N numbers using do - while.
20. What are the different types of control statements available 'C'. Explain them withan
example?
21. Write a 'C' program to convert Decimal Number to Octal number
19. Write a recursive function power (base, exponent) that when invoked returns base
exponent
20. Distinguish between user defined and built-in functions.
21. What is meant by function prototype? Give an example function prototype.
16. Differentiate between a pointer and a variable? How a pointer is declared and initialized?
What do you mean by pointer to another pointer?
17. Write a C function to convert the string passed as an argument to its uppercase
equivalent?
file and the name of the destination file are supplied by the user.
3. Explain the different modes that can be provided as a parameter to the fopen( ) function.
4. Write a complete C program for the following: There are two input files named first.dat
and second.dat. The files are to be merged. That is, copy the content of first.dat and then
the content of second.dat to a new file named result.dat.
5. Explain what is a text file and what is a binary file.
6. Write a complete C program for finding the number of words in the given text file. Assume
that the words are separated by blanks or tabs
7. Write a complete C program to reverse the first n characters in a file. The file name and the
value n are specified on the command line. Incorporate validation of arguments: that is, the
program should check that the number of arguments passed and also the value of n are
meaningful.
8. What is a file? How to open and close different types of files in C?
9. Explain the possible modes of opening files? In all these modes what happens when the
file doesnt exist and the file already exists?
10. Write a C program to copy the contents of a file to another file?
11. Distinguish between getc() and getchar() functions?
12. Explain the general format of fseek() function with illustrative examples?
13. Write a C program to append the contents of a file to another file?
14. Explain syntax with illustrative examples the functions support reading and writing
formatted data to and from files?
15. Write a C program to count characters and lines in a given file?
16. What is the purpose of the ferror() and feof() functions?
17. What are the possible ways to set the file pointer to the beginning of the file?
Algorithm.
I. To find value 88
II. To find the value 20
III. To find the value 8.
10. An Array contains 47, 3, 66, 32, 56, and 92. After two passes of a sorting algorithm, the
array has been rearranged to: 3, 47, 66, 32, 56, and 92. Which sorting algorithm among
selection, insertion, and bubble sort is used? Defend your answer?
11. An Array contains 3, 13, 7, 26, 44, 23, 98, and 57. Trace the steps using merge sort?
12. An Array contains 3, 13, 7, 26, 44, 23, 98, and 57. Trace the steps using quick sort?
11. What is a doubly linked list? What is the main advantage over singly linked list?
12. Trace the output string and the stack contents at every step in converting the expression
A * B / (C D) + E * F - G into postfix expression?