Introduction to Computer 1stsem 2024.pdf

Full Transcript

# **B.TECH CSE DEPARTMENT, IST YR. END SEMESTER (AUTUMN) EXAMINATIONS, 2024** ## **Subject Name: INTRODUCTION TO COMPUTING** ## **Subject Code: TIU-UCS-T105** - Full Marks: 70 - Time Allotted: 3 hours ### **Instructions:** * The figures in the right margin indicate full marks. * Candidates are r...

# **B.TECH CSE DEPARTMENT, IST YR. END SEMESTER (AUTUMN) EXAMINATIONS, 2024** ## **Subject Name: INTRODUCTION TO COMPUTING** ## **Subject Code: TIU-UCS-T105** - Full Marks: 70 - Time Allotted: 3 hours ### **Instructions:** * The figures in the right margin indicate full marks. * Candidates are required to give their answer in their own words as far as applicable. * Unless otherwise specified, the notations / symbols have their usual meanings. * Use of non-programmable calculators is allowed. ## **Group-A** (Answer any ten questions) 2 x10 = 20 ### **Q 1.** #### 1.1. Find the value of *m* and *n* after executing the following code snippet. ```c int i=10, m,n; m=i--; n = ++i + i; ``` #### 1.2. Name 4 bitwise operators and write one example of each. #### 1.3. Write the output of the following code snippet. ```c main() { int i=2, j=3, z; printf("%d ", i - ++j); } ``` #### 1.4. If 53/4 = 12, find the base of the number system used. Provide justification for your answer. #### 1.5. Find the output of the following code snippet. ```c for(i=0; i=3; i++) { break; printf("Inside Loop %d", i); } printf("Outside Loop %d", i); ``` #### 1.6. Name one each of non-weighted code, weighted code, cyclic code and self-complementing code representations. #### 1.7. Name the different methods for writing selection statements in C language. #### 1.8. Write the format of the ternary operator used in conditional check, with a suitable example. #### 1.9. What are the main differences between Linux and Windows Operating Systems? #### 1.10. Name 4 special registers found in a computer (Von Neumann Architecture). #### 1.11. Find the output of the following code snippet. ```c float x = 8.5; int y = 2; float z = x/(float)y; float z1 = (int)x/y; printf ("%0.3f %0.3f\n",z, z1); ``` #### 1.12 Write the structure of the switch-case construct in C language with an example. ## **Group-B** (Answer any 4 of the following questions) 5 x 4 = 20 ### **Q 2.** Represent (50.25)<sub>10</sub> in IEEE Double precision floating point number representation. Show detailed steps. ### **Q 3.** With a labelled diagram, explain the memory unit in a Von Neumann architecture. Include all the main components and registers in the unit. ### **Q 4.** Explain the difference between assembler, interpreter and compiler with suitable examples. Why is C called a functional programming language? ### **Q 5.** A sender S wants to send a code 1100 to a receiver R using even parity Hamming code protocol. By mistake R receives 1000. Write detailed steps to show how the position of the error is detected by R. ### **OR** ### **Q 6.** Write Algorithm and Pseudocode to check whether two numbers (both numbers taken as user input) are co-prime or not. (Co-prime numbers are those numbers that have only one common factor, namely 1.) Convert Gray code 10100 to BCD code. Write the steps to arrive at your answer. How many bits are present in the BCD code generated? ## **Group-C** (Answer any 3 of the following questions) 3 x10 = 30 ### **Q 7.** #### 7.(a) Given 3 positive integers a, b, c (in non-descending order) - each representing a side of a triangle, write a program in C to check if the triangle is a right-angled triangle and, if yes, display the area of the triangle. If the triangle is not a right-angled triangle, mention that accordingly. If no triangle is possible, mention that as well. Example. If a=1, b=2, c=3, no triangle is possible. If a=3, b=4, c=6, the triangle is not right-angled. If a=3, b=4, c=5, triangle is right-angled and area = ½ * base * height = 1/2*3*4= 6. #### 7.(b) Describe the various types of memory in a computer and arrange them in descending order of speed. ### **Q 8.** #### 8.(a) Write a C program to swap 2 given numbers using the comma operator, with the help of a temporary or third variable. You should use a maximum of 3 variables in your code. #### 8.(b) Convert the following: * (100110)<sub>Gray</sub> = (?)<sub>4</sub> = (?)<sub>6</sub> * (25.025)<sub>10</sub> = (?)<sub>BCD</sub> = (?)<sub>2</sub> * (771)<sub>8</sub> = (?)<sub>10</sub> = (?)<sub>4</sub> ### **Q 9.** What is an Operating System? What are the main functions of an Operating System? Describe different types of Operating System. ### **Q 10.** #### 10.(a) The monthly billing in an electricity company has the following process: The base slab for 100 units consumed is INR 250.00. * For every additional unit consumed up to 200 units, the charge per unit is INR 3.00. * For every additional unit consumed up to 500 units, the charge per unit is INR 4.00. * For every additional unit consumed up to 800 units, the charge per unit is INR 5.00. * For every additional unit consumed above 800 units, the charge per unit is INR 6.00 Draw a flowchart to find the total bill of a consumer in a month given the total monthly units consumed. e.g. If monthly units consumed is 100 units, bill = INR 250.00 If monthly units consumed is 200 units, bill = INR 250.00 + 100*3 = INR 550.00 If monthly units consumed is 900 units, bill = INR 250.00 + 100*3 + 300*4 + 300*5 + 100*6 = INR 3850.00 #### 10.(b) Write a C program which will accept a 4-digit positive integer number and print it after removing the odd digits. The input number cannot have the digit '0'. e.g., Input - 5432>Output-42; Input-2863>Output-286 ### **OR** ### Q 11. #### 11.(a) Draw a flowchart to find the LCM (Lowest Common Multiple) of 2 numbers *a* and *b* - that is, the lowest positive integer that can be divided by both the numbers. Example. If a = 10, b = 25, LCM = 50. If a = 121 and b = 7, LCM = 847 #### 11.(b) Explain what is meant by "nested if" and "nested for" statements. Give suitable examples.

Use Quizgecko on...
Browser
Browser