You are on page 1of 16

Final Technical Exam

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

Q8 : 1 – 2 – 4 – 8 – 16 – 32 – 64 – 128 – 256 -…-...-… What are the 3 missing numbers?


(a) 512-1026-2058 (b) 512-1024-2058 (c) 512-1024-2126 (d) 512-1024-2048
Q9 : What is the fasted communication protocols :
(a) UART (b) I2C (c) SPI

Q10 : Push-Pop mechanism is used in :


(a) Stack (b) Register (c) Memory (d) Index Register
Q11 :
X=3y-2 If 4X+20 is equal to 5y + 7, what is y equal to?
(a) 5.5 (b) 5 (c) 4.5 (d) 7

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 ?

Q21 : what is the meaning of the following syntax :


const volatile int x = 6 ;
Q22 :
Is there any difference between the following two statements?
char *p=0; (a) Yes
char *t=NULL (b) NO
Q23 :
Which bitwise operator is suitable for turning off a particular bit in a number?
(a) && operator
(b) ✓ & operator
(c) || operator
(d) ! operator

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.

Q28 : To tell the compiler not to optimize this variable we use


(a) Const
(b) Register
(c) Volatile
(d) Static

Q29 : Can we declare function inside structure of C Programming?


(a) Yes
(b) No
(c) Depends on compiler
(d) yes but run time error

Q30 : How to find the length of an array in C?


(a) sizeof(a)
(b) sizeof(a[0])
(c) sizeof(a)/sizeof(a[0])
(d) sizeof(a)*sizeof(a[0])

Q31 : what is the output?


#include<stdio.h>
int main()
{
enum days
{MON=-1,TUE,WED=6,THU,FRI,SAT};
printf("%d, %d, %d, %d, %d,%d\n",MON,TUE,WED,THU,FRI,SAT);
}
(a) -1,0,1,2,3,4 (b) -1,2,6,3,4,5 (c) -1,0,6,2,3,4 (d) -1,0,6,7,8,9
Q32 : How to Multiply number 5 By number 5 By Using shifting ?
Q33 : Q34 :
singed char x = 127; unsinged char x = 127;
x+=3; x +=3;
printf(“%d”,x); printf(“%d”,x);

Q35 : Q36 :
char x = 94; char x = 94;
x+=3; x+=3;
printf(“%c”,x); printf(“%d”,x);

Q37 : Q38 : Q39 :


int x = 5 ; int y = 20 ; int x = 0 ;
if ( x = 7 ) int x = 0; scanf(“%d”,x);
printf(“%d”,x) ; x = y << 2 ; printf(“%d”,x);
else printf(“%d”,x);
printf(“NICE”);

Q40 : discuss the built process

Q41 : What do you know about those modifiers ( Static , Volatile , extern , Register , atomic )
Q42 : What do you know about WDT ?

Q43 : What do you know about #define and typedef ?

Q44 : What do you know about Deadlock ?

Q45 : What the different between MC and MP ?

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

Q50 : what the output of :


int main(void)
{
uint32_t x = 2;
uint8_t* ptr1 = &x;
static uint32_t i = x;
printf("%i, %i, %d\n",*ptr1, i, *x);
}
(a) 2, 2, 2
(b) Runtime Error
(c) Compilation Error
(d) Runtime and Compilation Errors
Q51 :
n = 1;
printf("%d, %d", 3*n, n++);
(a) Output will be 3, 2
(b) Output will be 3, 1
(c) Output will be 6, 1
(d) Output is compiler dependent

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.

Q61 : continue the cycle :

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

Q63 : Apply MC/DC Testing Techniques on the following code


If ( ( x == 6 ) && ( y >= 7 ) || ( z != 1 ) )
Q64 :
enum weak { Sat , Sun , Mon , Tues , Wed , Thurs , Fri } ;
int x = 5 ;
if ( x == Wed ) printf (“ Yes ”);
else printf (“ No ”);
(a) Yes (b) No (c) YesNo (d) Compilation error

You might also like