Beruflich Dokumente
Kultur Dokumente
}
a) 1
b) 2
c) 4
d) 8
31. Which is the correct output?
void main ()
{
int i=5, j=6, z;
printf (“%d”, i+ ++j);
}
a) 12
b) 11
c) 10
d) 13
32. What is the value of (560)10 in hexadecimal number system?
a) (230)16
b) (200)16
c) (120)16
d) (260)16
33. What is the value of (2230)10 in hexadecimal number system?
e) (230)16
f) (200)16
g) (120)16
h) (260)16
34. What will be the result of (1010)2 + (1100)2?
a) (10110)2
b) (11010)2
c) (10100)2
d) None of these
35. What will be the result of (11010)2 - (10111)2?
a) (2)8
b) (3)8
c) (4)10
d) (00100)2
36. The purpose of mode r+ is to
a) Open only for reading
b) Open only for writing
c) Open for both reading and writing
d) None of these
37. What will be the result of (110)2 + (100)2?
a) (1010)2
b) (1110)2
c) (1000)2
d) None of these
38. What will be the result of (1010)2 - (0101)2?
a) (5)8
b) (7)8
c) (3)10
d) (0100)2
39. What will be placed in exponent field in case of the number (11.1010)2?
a) 1010
b) 4
c) 11
d) 11.1010
40. What will be the equivalent binary number of (1456)10?
a) (10110110000)2
b) (11110110100)2
c) (10111110000)2
d) (11110110000)2
41. What is the command to copy a file in DOS if src.txt is the source file and dst.txt is the destination
file?
a) copy src.txt dst.txt
b) copy dst.txt src.txt
c) copy from src.txt to dst.txt
d) copy from src.txt in dst.txt
42. The output of int
fact=1;
for(i=0;i<fact;i++)
{
fact=fact*i;
printf(“%d”, fact);
}
is
a) 24
b) 5
c) Infinite loop
d) None of these
43. Which of the following command is used to calculate the length of a string?
a) strlen
b) strln
c) strlength
d) strlgth
44. Which will be the output?
# define SQ(x) x*x
void main ()
{
int a=5, b; b=-
SQ(a+2);
printf(“%d”, b);
}
a) 7
b) -49
c) -17
d) None of these
45. Which will be the output?
void main ()
{
static int a=5;
a=a+3;
printf(“%d”, a);
}
a) 8
b) 5
c) Error
d) None of these
46. Which will be the output?
void main ()
{
int i=0;
do
{
i=i+2;
} (while i<3);
a) 4
b) 6
c) 2
d) None of these
a) xy +z
b) (x+y)z
c) (x’y+xy’)z
d) xy+x’y’+z
53. Which one of the following is primary constant?
a) Integer
b) Array
c) Structure
d) None of these
54. What will be the output?
void main ()
{
int x=9;
if (10)
printf (“%d”, ++x);
else
printf (“%d”, ++x);
}
a) 9
b) 10
c) 11
d) None of these
55. Fourth generation computer uses
a) VLSI
b) Simple integrated circuit
c) Semiconductor
d) Only transistor
56. What is the command in DOS to view the list of files located in current directory?
a) VIEW DIR
b) DIR
c) LIST
d) None of these
57. What will be placed in mantissa field in case of the number (11.1010)2?
a) 1010
b) 4
c) 11
d) 11.1010
58. What is the 2’s complement of (10011)2?
a) (01101)2
b) (01100)2
c) (01110)2
d) (01111)2
59. What is the 1’s complement of (1001111)2?
a) (0110000)2
b) (0110001)2
c) (0111010)2
d) (0111100)2
60. What is the 2’s complement of (10010)2?
(a) (14)10
(b) (12)10
(c) (14)8
(d) (01111)2
61. The function used to detect the end of file is?
(a) ferror()
(b) feof()
(c) fputs()
(d) fgetch()
62. De Morgans’s second theorem says that a NAND gate is equivalent to a bubbled ____ gate.
(a) AND (b) OR (c) XOR (d) none of these
63. A 32 bit microprocessor has the word length equal to
(a) 2 bytes (b) 4 bytes (c) 1 byte (d) 8 bytes
64. Which one is the right output?
int x = 9;
if(10)
printf(“%d”,++x);
else
printf(“%d”,x++);
(a) 9 (b) 10 (c) 11 (d) 12
65. In a C expression, how is a logical AND represented?
(a) @@ (b) ||
(c) AND (d) &&
65. what will be the value of I and m after execution of following code?
int i=5,m;
m=i++;
(a) 5 and 6;
(b) 5 and 5;
(c) 6 and 5;
(d)6 and 6;
3. a) Describe the functions of various units of a digital computer using a neat block
memory? 3
11. Why are NAND and NOR gates called Universal gates? Explain with example. 2.5
12. If K bytes are required to store a number in hexadecimal number system, find how many bytes
will be required to store the number in binary number system? 5
13. If C1 and C2 are two computer languages, what do you mean by the statement "The level of
language C1 is higher than that of C2." Is it possible to convert the language of a particular level
into another language of other level? If so, how? If no, why? 3+2
14. Write a C program to compute the average of a few input quantities with minimum use of storage
variable, where the number of inputs is not known beforehand. 5
15. What is the significance of different levels of computer language? 3
Module – II(C Fundamental)
1. Write a C program to find the simple interest and total amount where the principle amount is 3000,
number of year is two and rate of interest is 10%.
2. What is type casting? What is automatic type conversion? 3
3. Explain unary operation with example.
4. Write short notes on the following:
a) Bitwise operator
b) Assignment operator
c) Logical operator
d) Increment and Decrement operator
5. Centigrade to Fahrenheit. 3
6. State the basic features of structured programming language. 3
1. What is an array and subscript variable? 2 What condition must be satisfied by the entire element of
any given array? 2 (Ans. The entire elements of any given array have common characteristics. Then can be
characters, integers, floating-point numbers, structures, and so on. They must all, however, be of the same
type and the same storage class.)
2. Write a program in C to multiply two 2D matrices and display the resultant matrix. 5
Write a program which will create an n*n matrix. Transpose the matrix by passing it to a function. 5
3. Short notes on Array of pointers.
4. What is subscripted variable?
5. Explain “C does not support bound checking”.
6. Short notes on Pointer arithmetic
7. Allocate a two dimensional array dynamically using pointer in C language. 5
8. What is Dynamic memory allocation? Write down the difference between malloc() and calloc(). 3
9. Short notes on Void pointer & Null pointer.
10. Short notes on Dynamic memory allocation.
11. Sum of two matrices. 3
12. Explain call by value and call by reference by example and How they differ?. 5
13. Short note on pointer. 5
14. Briefly explain the arrange of n numbers in ascending orders. 5
16. Write a C program to check if a string taken as input is a palindrome or not without using string related
functions supported by the compiler.
17. What are compile-time and run-time array initialization?
18. Write a function to sort an array. Display the sorted array inside the main() function. 5
6. What is the difference between structure and union with example? 2/4
[PART – C]
3.
a) What is a program? How it is different from an algorithm? Distinguish between flowchart and
algorithm. Explain with an example.
b) Write down the characteristics of an algorithm.
c) What is a flow chart? Find out the sum and average of all integers ranges from 50 to 100 and divisible by
both 2 and 3 using a flowchart. [5+5+5]
4.
a) What is main frame computer? How it is different from mini and micro computer? What are the
components used in an analog computer?
b) What is main memory? Compare main memory, secondary memory, cache memory and register set.
[1+2+2+2+8]
5. a) Explain two input Exclusive OR (XOR) gate using truth
table. 2 . 5 b) Simplify (A+B’).(A.C)+(AB’+A’C).(A+D)’ 4
Simplify: A’(A+B)+(B+A)(A+B’)
Represent the following expression using logic gates,
S=(AX+BY)+(CD+EF)
c) Convert:
i) (779)10 = (?)8
ii) (3 AF)16 = (?)8
iii) (34.465)10 = (?)2
(2AD)16=()2?
(11100111101)2=()16
(25.125)10=()2
(45.5675)10=()16 6 [4+5+6]
6. a) What is the difference between high level language and machine language? What is assembly
language? Does it platform independent? Justify your answer.
b) Explain ASCII and BCD. Find out the equivalent BCD form of (1335)10. What is extended ASCII?
[3+3+1+2+2+2+2]
7. Write down the DOS commands for the following:
i) Copy a file a.txt into another file b.txt present within the same
directory
ii) Display the current time and date
iii) Display all the files maintained in the current directory
iv) Create a new directory
v) Rename a file a.txt to x.txt [5 x 3]
9. Draw the flow chart to display the first n terms of the Fibonacci series. The first two terms of the series are
respectively 0 and 1. The nth term of the series F is defined as Fn=Fn-1+Fn-2 5
10. Write an algorithm to find the sum of the first n numbers, where n should be read from the user. 5
11. Write an algorithm to find the largest among numbers, taken from the user.
Module II (C Fundamental)
2. a) Write a C program to swap the values of two variables with and without using the third variable.
b) What is the difference between expression and statement?
c) Discuss Escape Sequence in C. [5+5+5]
3. a) Give a numerical example of using modulus operation %.
b) What will happen if % is used between two float variables?
c) How can you evaluate (-b +√(b2- 4ac)\2a) in the C language? [5+5+5]
1. Using conditional operator write a C program to find out the largest among two numbers taken as
input.
2. Write a C program to calculate the gross salary (sum of basic salary, DA, HRA) of an employee where
DA is 35% of basic salary, HRA is 15% of basic salary and basic salary is taken as input.
3. Write a C program to find the simple interest and total amount where the principle amount is 3000,
number of year is two and rate of interest is 10%.
4. What is ternary operator? Explain with an example. 2+1
5. What is type casting? What is automatic type conversion? 3
6. Explain unary operation with example. 5
7. Write a function in C to swap the values of two variables without using a third variable.
8. Explain bitwise operators. What is the difference between i++ and ++i? 5
9. What are the types of constants used in C?
10. Write short notes on the following:
e) Bitwise operator
f) Assignment operator
g) Logical operator
h) Increment and Decrement operator
9. Write a complete C program to calculate the G.C.D. of three numbers taken as input.
10. Differentiate between “break” and “continue” with an example. 5
What is the utility of break statement in loop? Give an example. How is break statement different from exit(). 4
11. Write a complete C program to check whether a number if prime or not. 5
12. Write a C program to evaluate the following summation series where the range will be taken as input
13. Write a C program to print the sum of the following series (upto n terms where n should be given by the
user)
14. Draw a flowchart to find out the biggest number among given three numbers.
15. Write a C program to implement 4 function calculator using Switch statement.
16. Explain unary, binary and ternary operators in C with example.
17. What will be the output?
int main()
{
int a=8, b=10;
a=a++ + --b;
b=++b + a--;
printf(“%d %d”, a, b);
return 0;
}
18. Use ternary operator to find out the minimum among three numbers. 3
19. Write a C program to check whether a given year is Leap year or not.
20. What is a loop? Distinguish between while and do-while loop with an example. 3
21. Write a C program to reverse a given number.
22. Write a C program to print the following:
1
2 3
4 5 6
7 8 9 10
23. Write a C program to print the following pattern (till n rows, where n is taken as input)
1
2 2
3 3 3
4 4 4 4
24. Write a complete C program to calculate the G.C.D. of three numbers taken as input.
25. Write a C program to print the following star orientation till n rows where n is the i/p:
*
* *
* * *
* * * *
Write a C program to print the following pattern 5
1
232
34543
4567654
26. Write a complete C program to print prime numbers within a given range.
27. Write a C program to check whether a number is strong or not.
1. Write a program to input a n X n matrix and print the maximum element of the matrix.
2. (a) What is subscripted variable?
(b) Write a complete C program to convert a decimal number consisting of arbitrary
number of digits into its binary form using 1 -D array.
(c) Write a complete C program to find out the Trace of a square matrix [Trace means the sum of
Principal Diagonal Elements].
3. (a) How can you represent a string using the C programming language? 1
(b) Name any five string functions whose prototype is defined in the string.h header file.
Explain the work of any two of them. 5
(c) Write a C program to find the number of vowels and consonants in a line text. 4
(d) Write a C program to convert all lower case alphabets to upper case alphabets, a line of text 5
4. Palindrome string check. 5
5. Explain C doesn’t support bounds checking. 2
6. What is the difference between a character array and a string? 5
7. Write a function which will split a string into two halves and return the result as an array of string. 6
Module VI (Fundamentals & Program Structures)
1. Write a function (recursive/non-recursive) power (a, b) that can calculate ab for any floating
a and positive integer b. Invoke this function into main function to calculate xn.. 2
2. Write a recursive function to find the summation of 1st n natural numbers and test the function by
calling from main function.
3. Write a C function to find the cube of a number and use this function in main () function to evaluate
x3+ y3+ z3, where x, y, z are read through standard input device.
4. Write a function to find out the real roots of a quadratic equation using user defined
function quad(). 7
5. Write a C program to find out the GCD a n d L C M of two numbers using recursion or
iteration. 5
6. What is recursion? Explain recursion with an example. What are the advantages and
disadvantages of recursion? 2+3
1. Define a structure called cricket that will describe the following information: 9
i) Player Name
ii) TeamName
iii) Batting Average
Using cricket declare an array player with 50 elements and write a C program to read the
information of all the 50 players and print the name of the player having the highest batting
average.
2. a) What is structure in C? Why it is used? How is it
declared? 2
b) Declare a structure having members of appropriate type
Branch
Name
Roll No
Marks in 8 subjects
Write a C program to create an array of 30 structure variables and read all the members of each
variable. 9
3. (a) Explain with suitable example, the difference between structure and union in a C program.
(b) Suppose you have to create and maintain a Record Book of your company. Record Book
consists of the following fields: (i) Employee's Name (ii) Id Number (iii) Salary Amount (iv)
Designation. How do you create and maintain this Record Book for 150 Employees of your
organization if your management asks to see the salary of any particular employee? 6
(c) Explain Call-by-Value and Call-by-Address with examples. 6
4. Write a C program that will receive a file name and a line of text as command line arguments and
write the text to that file. 7
5. Can we read from a file and write to the same file without resetting the file pointer? Justify.
6. Create a structure to specify data on students give below:
Roll Number, Name, Department, Course, and Year of
admission. Assume that there are not more than 450 students
in collage,
Write a program to print names of all students who joined in a particular year. 7
7. (a) Write a C program to create a copy of a text file "file 1.txt”" into another "file 2.
txt”. 9 (b) What is the difference in opening a file in "r+" and "w+" modes? 3
(c) What do the fprintf( ) and fread( ) functions do?
3
8. Write a C program to accept a string as a command line argument/without command line argument and hence
find its length without using strlen(). 9
[PART – D]
Module II (C Fundamental)
1. Describe the four basic data types. How could we extend the range of the values they represent?
2. What is an unsigned integer constant? What is the significance of declaring a constant unsigned?
3. What do you mean by declaration and definition of a variable?
4. What is the importance of flowchart?
5. What is the use of ASCII?
6. What are escape sequence characters? What is the purpose of use them?
7. What are the return type and return value of printf( ) and scanf( ) functions?
8. What do you mean by overflow and underflow of data?
#include<stdio.h>
int main(){
int x=55;
printf("%d, %d, %d\n", x<=55, x=40, x>=10);
return 0;
}
6. Write a program which will check whether a square matrix is lower triangular or not?
7. Write a program which will check whether a square matrix is upper triangular or not?
8. Write a program which will find out trace (sum of all diagonal elements) of a square matrix.
9. What is array of pointers? Explain with an example. What is the relationship between array and
pointers? 5
10. What is pointer to an array? Explain with an example.
11. With an example show the passing of 2D array into a function.
12. Why a[5] == 5[a]? Explain.
13. What do you understand by const pointer? Explain with an example
14. Why we can not add two pointers?
15. Why are pointers different sizes on different machines?
16. Can I convert a pointer to an ordinary number? Give your logic.
17. Does C use the sizeof operator when it is adjusting pointer arithmetic? Give your logic.
18. Is it possible to write scanf statement without ‘&’ operator. Give your logic with an example.
19. What is the output? 3
void fun(int *i,int *j);
main(){
int i=5,j=2;
fun(&i,&j);
printf("\n%d %d",i,j);
}
fun(int *i,int *j){
*i=*i* *i;
*j=*j* *j;
}
Enum
1. Enumerated data type. 5