Professional Documents
Culture Documents
Name :
Group :
Q1 :
int main()
{
int a = 5, b = 3, c = 4;
printf("a = %d, b = %d\n", a, b, c); return 1;
}
(a) a=5, b=3 (b) a=5, b=3, c=0 (c) a=5, b=3, c=4 (d) a=5, b=3,0
Q2 : How many times the below loop will run for the following pseudo code:
int i=0;
do
{
--i;
print "i";
i++;
} while(i>=0)
Assuming that integer will be used for variable "i"
(a) 0 (b) 1 (c) infinite output (d) -1
Q3 :
public static void main (string args[])
{
int result, x;
x=1;
result = 0;
while (x <= 10)
{
if (x%2== 0) result + = x;
++x;
}
System.out.println(result);
}
(a) 55 (b) 30 (c) 25 (d) 35 (e) 45
Q4 : What is the difference between declaring a variable and defining a variable?
Give example only
Q5 : For the following pattern 2, 20, 1, 10, 0.5, 5, 0.25, 2.5, 0.125, 1.25, ----
What comes next in the pattern?
(a) 0.0620 (b) 0.0625 (c) 0.625 (d) 0.00625
Q6 : Observe the following pattern: T/3/Q/6/N/9/K/12/H/15/E/18/----
What comes next in this pattern?
(a) B (b) с (c) D (d) 21
Q7 :
If you move 5steps north, 4steps east, 3steps north, 5steps west, 12steps south, then 1step east,
how many squares are you from the starting point?
(a) 4 (b) 5 (c) 3 (d) 2
Q12 :
x = 7 , y = 5 , M = 2 , L=1 , z= 10
what the output of : x & y | M ^ L ( ~ z )
Q13 : A=3 B=5 C=8 Which of these equations do not equal to 30?
(a) 5A + 5A (b) 3B + 2C (c) 5A + 3B (d) 3C - A
(e) 4C - 2A – B (z) 12A - B
Q14 :
unsigned char arr[] = {1,5,3,9,7,2}
unsigned char* p
p++;
(*p)++;
What is the value of *p ?
(a) 5 (b) 3 (c) 2 (d) 10 (e) None of the Above
Q15 : what is the following for (;;)
Q16 : 2, 6, 1, 3, 0.5, 1.5, ---- What is the missing number x ?
(a) 0.5 (b) 3 (c) 0.25 (d) 0.15
Q17 :
int z, x=5, y=-10, a=4, b=2;
z=x++ y *b/a;
What is the value of z?
(a) 12 (b) 11 (c) 10 (d) 6 (e) 5 (f) None of above
Q18 :
In the given below statement, what does the "pk" indicate?
int (*pk)0:
(a) "pk" is a pointer-to-function that has a return of "int"
(b) "pk" is a pointer to variable of type "int"
(c) "pk" is the index of the element that we want to access by a pointer
(d) None of above
Q19 :
Which of the following protocols allows a full duplex synchronous communication between a
master and a slave?
(a) Serial port (b) SPI (c) 12C (d) Parallel port
Q20 : what do you know about preprocessors ?
Q24 :
Which of the following cannot be checked in a switch-case statement?
(a) Character
(b) Integer
(c) Float
(d) Enum
Q25 :
Which of the following is the first module of a language processing system ?
(a) Preprocessor
(b) Loader
(c) Compiler
(d) Linker
Q26 :
What will be the output of the program?
#include<stdio.h>
int main()
{
int i=0;
for(; i<=5; i++);
printf("%d", i);
return 0;
}
(a) 0, 1, 2, 3, 4, 5 (b) 5 (c) 1, 2, 3, 4 (d) 6
Q27 : Static keyword with local variables affects :
(a) Scope.
(b) Life time.
Q35 : Q36 :
char x = 94; char x = 94;
x+=3; x+=3;
printf(“%c”,x); printf(“%d”,x);
Q41 : What do you know about those modifiers ( Static , Volatile , extern , Register , atomic )
Q42 : What do you know about WDT ?
Q46 :
How is an array initialized in C language
(a) int a[] = {4,3};
(b) int a = {4,3};
(c) int a[] = new int[3];
(d) int a[2] = 3;
Q47 :
what is the similarity between a structure, union and enumeration?
(a) All of them let you define new values.
(b) All of them let you define new data types
(c) All of them let you define new pointer
(d) All of them let you define new structures
Q48 : What will be the final value of x in the following C code?
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
(a) 57.3
(b) Depends on compiler
(c) 24
(d) 5
Q49 : Which part of the program address space is p stored in the following C code?
#include <stdio.h>
int *p;
int main()
{
int i = 0;
p = &i;
return 0;
}
(a) Code/text segment
(b) Data segment
(c) Bss segment
(d) Stack
Q52 :
Two nodes can talk at the same time if the communication protocol is working in _____ mode
(a) Full Duplex
(b) Half Duplex
(c) Simplex
(d) All of them
Q53 : Write the Syntax of structure , union and enumeration , and what the size of each of them.
Q54 : what is the output of this code , and how to minimize the size if you want ?
Q55 : what is the output of this code , and how to minimize the size if you want ?
Q56 : Develop a software of Calculation
Q57 : Write Program to check grade of student where A means Excellent , B means V.Good , C
means Good , D means Pass and F means Fail .
Q58 : Find large number of 10 numbers.
Q59 : Turn on led on pin 6 in port d when pressing a button connecting in pin 3 in port c , then
delay 2ms and turn off this led and delay 2ms too , repeat this flashing only 100 times
Q60 :
Draw the connection between 2 AVR that one of them connected to LCD and anther one to
Keypad, connected them together by using SPI communication protocols.
Ready
Dormant Waiting
Run
Q62 : How scheduler will handle the following tasks :
T1 = 1ms with priority 2
T2 = 2ms with priority 1
T3 = 3ms with priority 3
T4 = 2ms with priority 1
T5 = 1ms with priority 2
With the following Algorithms FCFS , SJF , HPF and RR