You are on page 1of 3

17 1/Point out the error in the program?

18 The binary equivalent to 240(10) is


struct emp A) 11100110
{
int ecode; B) 11100110
struct emp e; C) 11110000
}; D) 11100010
A) Error in structure declaration
B) Linker Error
C) No Error
D) None of above

19 Given an 8 bits, unsigned integer A = 105. The result 20 The following are all application software except for
of NOT(A) in binary is A) Microsoft Excel
A) 10110 B) Microsoft Power Point
B) 10101 C) Microsoft Windows
C) 10010110 D) Microsoft Word
D) 10010101

21 Which of the following cannot be a structure 22 In binary numbers, shifting the binary point one
member? place to the left means.
A) Another structure A) multiplying by 2
B) Function B) dividing by 2
C) Array C) decreasing by 2
D) None of the mentioned. D) increasing by 2

23 The octal equivalent of the number 11010.1011 is 24 The memory which is programmed at the time it is
A) 32.54 manufactured is
B) 62.51 A) CDROM
C) 32.51 B) Punch cards
D) None of the above C) RAM
D) ROM

25 Conversion of a hexadecimal number 4E(16) to 26 Ethernet uses


binary number is A) Bus topology
A) 1001101 B) Ring topology
B) 1001110 C) Star topology
C) 1101100 D) Tree topology
D) 110111

27 Which of the following function is used to find the 28 The correct syntax to access the member of the ith
first occurrence of a given string in another string? structure in the array of structures is?
A) strchr() Assuming: struct temp
{int b;}s[50];
B) strrchr()
A) s.b.[i]
C) strstr()
B) s.[i].b
D) strnset()
C) s.b[i]
D) s[i].b

29 Which of the following function is more appropriate 30 The correct result of converting binary number
for reading in a multi-word string? 101001101.01100001 to hexadecimal, is:
A) printf(); A) 14D.68
B) scanf(); B) 34D.7C
C) gets() C) 34D.1F
D) puts(); D) 14D.61
5 What will be output if you will execute following c 6 What will be output if you will execute following C
code? code?
#include<stdio.h> #include<stdio.h>
int main(){ main(){
int num,a=5; int a[11]={0,1,2,3,4,5,6,7,8,9,10};
num=-a--; int i=0,num;
printf("%d %d",num,a); num=a[++i+a[++i]]+a[++i];
} printf("%d",num);
A) 5 4 }
B) -4 4 A) 6
C) -5 4 B) 7
D) -4 5 C) 8
D) 9

7 The value of A and B after executing following 8 Which function definition will run correctly?
pseudo code A) int sum(int a, int b)
A=1B =2 return (a + b);
if (A<B) then
B) int sum(int a, int b)
A=B
{return (a + b);}
B=A
end if C) int sum(a, b)
return (a + b);
A) A = 1, B = 1
D) Both (a) and (b)
B) A = 1, B = 2
C) A = 2, B = 2
D) A = 3, B = 1

9 The address and control bus of a CPU has width of 10 Which of the following abbreviations describes a
32 bits and 30 bits, respectively. Determine the protocol of computer network?
maximum size of main memory if each stack has size A) CMOS
of 8 bits.
B) FTP
A) 1 GB
C) HTML
B) 3 GB
D) LAN
C) 4 GB
D) 8 GB

11 Which of the following values is of decimal number 12 Which of the following values is of hexadecimal
120 in hexadecimal system? number B3A in binary system?
A) 76 A) 101010110001
B) 77 B) 101100111010
C) 78 C) 101101011010
D) 79 D) 110011001011

13 Which of the following retains the information it 14 ............OS provides process and memory
stored when the power to the system is turned off? management services that allow two or more tasks,
A) CPU jobs, or programs to run simultaneously
B) ROM A) Multitasking
C) RAM B) Multithreading
D) Cache C) Multiprocessing
D) Multicomputing

15 The software that the users have the freedom to run, 16 Which one is true for unconditional disk formatting?
copy, distribute, study, change, and improve is A) Destroys every byte on a disk by overwriting it with
A) Free software with blank spaces
B) Rental software B) Do not check/scan surface after formatting
C) Commercial software C) Transfer system files after formating
D) Share software D) All of above
Part I: Multiple Choice Questions
1 Which of the following statements are correct about 2 What will be output if you will execute following c
the program below? code?
#include<stdio.h> #include<stdio.h>
#include<string.h> main(){
int main() int a=5;
{ {
char str[20];int i; int b=10;
printf("Enter a string\n"); ++b;
scanf("%s", str); ++a;
{
while(str[i] != '\0') int a=20;
{ ++a;
if(str[i] >= 97 && str[i] <= 122) a=++b;
str[i] =str[i]-32; }
i++; ++a;
} ++b;
printf("%s",str); printf("%d %d",a,b);
return 0; }
} printf(" %d",a);
A) The code converts a string in to an integer }
B) The code converts lower case character to upper A) 7 13 7
case B) 13 13 5
C) The code converts upper case character to lower C) 13 13 13
case D) Compilation Error
D) Error in code

3 What is the output of this C code 4 What will be the output of the program ?
#include <stdio.h> #include<stdio.h>
#include <string.h> #include<string.h>
struct student int main()
{ {
char name[20]; char str1[20] = "Hello", str2[20] = " World";
}; printf("%s\n", strcpy(str2, strcat(str1, str2)));
struct student s[2]; return 0;
main() }
{ A) Hello
strcpy(s[0].name,"my");
s[1] = s[0]; B) World
printf("%s%s", s[0].name, s[1].name); C) Hello World
strcpy(s[1].name ,"darling"); D) WorldHello
printf("%s%s", s[0].name, s[1].name);
}
A) mymymydarling
B) mymydarling
C) mydarlingmydarling
D) Run time error

You might also like