Sunday, August 28, 2016

Assignment No: 1

1. What are the characteristics of an electronic computer? Discuss its applications.
2. Explain the memory hierarchy of computer.
3. How can you classify computers on the basis of principle of working? Explain.
4. Classify the OS into different types based on their processing capability.
5. What is a translator? What type of software is it?
6. Write down any four characteristics of a good programming language.
7. Differentiate between the following:
   a. Compiler and Interpreter
   b. High-level and Low-level languages
   c. Hardware and Software
8. What are Input / Output devices? Discuss any two of them.
9. What is an operating system? How does it act as a resource manager? Briefly explain the terms multiprogramming and multithreading.
10.Explain the compilation and execution of a program written in high-level language.
11.Convert the following:
   i.   (311.55)10 = ( )2
   ii.  (100)10 = ( )8
   iii. (BC)16 + (DE)16 = ( )16
   iv.  (45)6 = ( )3
   v.   (AB4F.C1)16 = ( )10
   vi.  (AC01.2DB)16 = ( )8
   vii. (.11)2 = ( )8
   viii.(1011.01)8 = ( )10
   ix.  (459.25)10 = ( )2
   x.   (11001011.11)2 = ( )8
   xi.  (ABC)16 + (AB)16 = ( )8
   xii. (BABA)14 - (CAB)14 = ( )6
   xiii.(-49)10 + (29)10 = ( )2
   xiv. (.825)10 = ( )8
   xv.  (.42)10 = ( )15

12.Write an algorithm and draw a flowchart to convert the given time in seconds into its equivalent time in hours, minutes and seconds as output.
    (e.g. 7322 seconds is equivalent to 2 hours 2 minutes 2 seconds)
13.Write an algorithm and draw a flowchart to find the prime factors of a number given by the user.
14.Write an algorithm and draw a flowchart to compute the sum of squares of integers from 1 to 50.
15.Write an algorithm and draw a flowchart to print the sum of the following series:
    1 + 1/2! + 1/3! + … up to n terms where n is given by the user.


Sunday, April 17, 2016

QB-Unit 5

2 MARKS

1.      What is void pointer? How is it different from other pointers?
2.      Define double pointer with example.
3.      What is the full form and significance of EOF?
4.      Distinguish between #ifdef and #if directives.

5 MARKS

1.      What is the difference between call by value and call by reference? Write a program to swap two floating point numbers using call by reference method.
2.      What is a pointer? What are they required? With reference to pointer define the work of & operator? Write a program in ‘C’ using pointers to swap two numbers.
3.      Write a program to print out our array using the array notation and by dereferencing pointer.
4.      Explain with example defining and calling macros and conditional compilation.
5.      Write a simple C program to show the use of string handling functions.
6.      Describe the use and limitations of the functions getc() and putc(). Write a program in ‘C’ to read data from the keyboard, write it to a file called INPUT, again read the same data from INPUT file, and display it on the screen.
7.      What is a string? Write a program in ‘C’ that allows the user to enter a string and perform the following operations on it:
a.       Count number of characters in string
b.      Remove spaces in string
c.       Count number of words in it
8.      Explain the role of the C preprocessor. What is macro and what precautions one should take when using macros with arguments? What are the advantages of using macro definitions in a program? Give one example of using macro in a program.
9.      Write a program in ‘C’ to read data from keyboard, write it to a file named PASCO, again read the same data from the file PASCO and display number of characters, number of vowels and number of lines contained in it on the screen.
10.  Write a program in ‘C’ to create a list of ten elements using dynamic memory allocation and display the sorted list.

QB-Unit 4

2 MARKS

1.      What is an array? Also give its important properties.
2.      Declare and initialize three dimensional array.
3.      What is the need of dynamic memory allocation?
4.      Write output of the following:
printf(“%d”, strcmp(“Quiet”, “Quilt”));
5.      What is meant by the following terms:
a.       Nested structures
b.      Array of structures

5 MARKS

1.      What are subscripts? How are they specified? What restrictions apply to the values that can be assigned to subscripts in “C” language?
2.      Describe structure. Differentiate between structure and array. Define a structure data type called time_struct containing three member’s integer hour, integer minute and integer second. Write a program in ‘C’ that would assign values to the individual members and display the time in the following form:
16:40:52

3.      Write a program in ‘C’ to sort list of 10 integers in an ascending order.
4.      Write a program in ‘C’ to multiply the two matrices of M X N.
5.      What is dynamic memory allocation? How does it help in building complex programs? What is the task of the following memory allocation functions?
a.       malloc
b.      calloc
6.      Write a program in ‘C’ to create a database of fifty students to store personal details such as Roll No., Name and Marks. Print all the details of student whose name is entered by user.
7.      Write the difference between structure and array. Write a program in ‘C’ to find the largest element of a 3X3 matrix.
8.      Define Union. Write a program in C to find the record of a student having maximum marks from the list of 10 records. Each record has roll no, name, class and marks fields.

QB-Unit 3

2 MARKS

1.      What are decision control structures in ‘C’?
2.      Name any two pre-test loops.
3.      What is the difference between while and do-while loop?
4.      How can we use ‘for’ loop when the number of iterations is not known?
5.      What is the difference between break and continue in’C’? Explain taking an example.
6.      What do you understand by modular programming?
7.      What is the need of functions?
8.      What is a function prototype? Why is it required?
9.      What is the difference between formal parameters and actual parameters?
10.  What is the difference between recursion and iteration?

5 MARKS

1.      Describe the types of looping statements in ‘C’ with necessary syntax.
2.      Differentiate between nested if and switch statements in ‘C’ with example.
3.      W.A.P. to design a calculator that can add, subtract multiply and divide any two numbers using switch case.
4.      Write a program in ‘C’ to read an integer number from keyword, add 1 to it if the number read is even, again add 1 to it if the number is less than 20, otherwise keep the number unchanged and print the final result.
5.      Given a number write a program in ‘C’ using while loop to reverse the digits of the number. For example, the number 12345 should be outputted as 54321.
6.      Write a program in ‘C’
a.       To find the largest among given 3 numbers
b.      To find the sum of the digits of a number
c.       To find sum of even and odd numbers from first 100 integers
d.      To find whether a number is prime or not.
e.       To generate 10 Fibonacci numbers
7.      Write a program in ‘C’ to print the following pattern”
1
2    3
4    5          6
7    8          9          10

8.      Discuss the different types of functions used in ‘C’ language.
9.      Write a program in ‘C’ to calculate the area and perimeter of a circle for a given radius using user defined single function which returns area and perimeter to the main function.
10.  What is recursion? Write a C program to find the factorial of a given number using recursion.
11.  Write a program in C to generate Fibonacci series (0  1  1  2  3  5  8….) using recursive function.
12.  What is the difference between ‘call by value’ and ‘call by reference’? explain with an example.

QB-Unit 2

2 MARKS

1.      What do curly braces denote in C? Why does it make sense to use curly braces to surround the body of a function?
2.      State the difference between
#include<filename>  and  #include”filename”

3.      What is a keyword? How is it different from an identifier?
4.      What are the various rules for naming identifiers?
5.      What do you understand by modifiers?
6.      What is an escape sequence? Explain taking an example.
7.      What is a variable? How is it declared?
8.      What is the difference between declaration and initialization of a variable?
9.      Differentiate between local and global variable.
10.  How do you define constants? Explain by taking an example.
11.  What is an expression? Explain arithmetic expression.
12.  Why we use relational operators? Explain various relational operators.
13.  What is the difference between unary operator and binary operator?
14.  What is the difference between logical operator and bitwise operator?
15.  What is importance of increment operator? Differentiate between pre increment and post increment.
16.  What are the various shorthand assignment operators?
17.  Explain associativity and precedence property of an operator.
18.  What is the difference between implicit and explicit type casting?
19.  Find the value of Y (assume Y is integer data type)

Y= 4 * 2 / 4 – 6 / 2 + 3 % 2 * 6 / 2 + 2 > 2 && 4 !=2

20.  Differentiate between getchar and scanf functions. In response to the input statement

         scanf(“%4d%*%d”,&year,&code,&count);
The following data is keyed in 19883745, what values does the computer assign to the variables year, code, count?

5 MARKS

1.      Discuss the fundamental data types available in ‘C’ language, along with its memory utilization, range, format specifier, etc.
2.      What is a storage class? Describe automatic, register, static and external with neat syntax.
3.      Briefly discuss the operators available in the ‘C’ language.
4.      Discuss about the formatted and unformatted input/output functions of ‘C’.
5.      Write a program to find the largest of three numbers using conditional operator.

2015-16 (ODD SEM)

NCS-101

B.Tech.

(Sem. I) THEORY EXAMINATION, 2015-16

COMPUTER SYSTEM & PROGRAMMING IN C

Time: 3 Hours]                                                                            [Total marks: 100

Note: Attempt all questions from all sections as per directions.

Section – A

1.      Attempt all parts of this section. Answer in brief.   (2 X 10 = 20)
a.       List five internal and external commands used in DOS operating system.
b.      Explain the basic structure of C program.
c.       How binary file differ from text file?
d.      Give difference between android and window OS.
e.       Differentiate between structure and union.
f.       What is void pointer? How is it different from other pointers?
g.      Justify operating system is a resource manager.
h.      Explain the dot (.) operator in C language with proper example.
i.        What do you mean by operator precedence?
j.        Write difference between implicit and explicit type casting.

Section – B

Attempt any five questions from this section.  (10 X 5 = 50)

2.      What are the difference types of functions? Write a program in C to sort list of names of students in an ascending order.
3.      Write a short note on top-down program development approach.
4.      Write a program in C to reverse a string through pointer.
5.      Write difference between call by value and call by reference using suitable example.
6.      What are the characteristics of an algorithm? Write an algorithm to find the sum of all the numbers divisible by 3 between 11 and 50.
7.      Illustrate and compare the static and extern storage classes with a relevant example in C.
8.      State the features of pointers. Write a C program to sort a given number using pointers.
9.      Differentiate between the following:
a.       High level language and low level language
b.      Linker and loader
c.       Logical error and run time error
d.      Algorithm and flowchart

Section – C
           
              Attempt any two questions from this section.    (15 X 2 = 30)

10.  What are the various types of files that can be created in C language? Also give different modes in which these files can be used with proper syntax. Write a program in C language to append some more text at the end of an existed text file.
11.  Attempt all parts:
a.       Write a C program to check whether a given square matrix is symmetric or not.
b.      Define data types in C. discuss primitive data types in terms of memory size, format specifier and range.
c.       List out various file operations in ‘C’. Write a C program to count the number of characters in a file.
12.  Attempt all parts:
a.       Write the difference between type conversion and type casting. What are the escape sequences characters?
b.      What are the different types of operators in C language and also write down the difference between the associativity and precedence of operators.

2014-15 (EVEN SEM)

NCS-201

B.Tech.

(Sem. II)THEORY EXAMINATION, 2014-15

COMPUTER SYSTEM & PROGRAMMING IN C

Time: 3 Hours]                                                                           [Total marks: 100

Note: Attempt all questions as per instructions

1.      Note: Attempt any FOUR parts. Each part carries equal marks. (5 X 4 = 20)
a.       Draw the memory hierarchical structure of a computer system. Explain each memory unit in brief.
b.      What is an operating system? Describe the functionalities of operating system.
c.       Describe Compiler, Interpreter, and assembler? Write the names of compiler that are used in C programming.
d.      What do you mean by Algorithm? Explain the properties of algorithm.
e.       Differentiate high level and machine level language.
f.       What is pseudo code? Difference between flowchart and algorithm with example.

2.      Note: Attempt any TWO parts. Each part carries equal marks.   (10 X 2 = 20)
a.       What do you understand by ASCII value of a character? Can we use expressions including both integer data type and character data type? Justify your answer.
b.      Write the difference between Type Conversion and Type Casting. What are the escape sequence characters?
c.       Convert following numbers into:
                                                              i.      (11010.0110)2                         =          (…)10
                                                            ii.      (110101011.0110110)2           =          (…)8
                                                          iii.      (2B6D)16                                =          (…)2
                                                          iv.      (AB4F.C1)16                          =          (…)10
                                                            v.      (54)6                                        =          (…)4

3.      Note: Attempt any TWO parts. Each part carries equal marks.   (10 X 2 = 20)
a.       Give the loop statement to print the following  sequence of integer
-6  -4  -2  0  2  4  6;
b.      What are the main principles of recursion?
c.       If int a = 2, b = 3, x = 0; Find the value of x = ( ++a, b+=a ).

4.      Note: Attempt any TWO parts. Each part carries equal marks.  (10 X 2 = 20)
a.       What are the different types of operator in C language and also write down the difference between the associativity and precedence of operators.
b.      (i) What is the role of SWITCH statement in C programming language? Explain with example.
(ii) Distinguish between actual and formal arguments and global and extern variable.
c.       Describe call by value and call by reference with example

5.      Note: Attempt any TWO parts. Each part carries equal marks.    (10 X 2 = 20)
a.       Write a program in C language to generate Fibonacci series.
b.      What do you mean by dynamic memory allocation? Explain the following functions in detail:
                                                              i.      free
                                                            ii.      calloc
c.       Write a program to add matrices of dimension 3 * 3 and store the result in another matrix.