Correct Answer:
p is a pointer to an array of integer pointers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Both options a and c.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
0xFFFFFFFF
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ptr1 = fopen("a.dat","r");
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It is a read-write technology that uses a type of electronic flip-flop for information storage.
It does not require refreshing.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following code?
#include<stdio.h>
#include<stdlib.h>
struct abc
{ int data;
struct abc *next;
};
void xy1(struct abc* head)
{ if(head == NULL)
return;
xy1(head–>next);
if ((head–>data)%2==0)
{printf("%d ", head–>data*31);}
else
{printf("%d ", head–>data*21); }
}
void xy2(struct abc* start)
{ if(start == NULL)
return;
if(start–>next != NULL )
xy2(start–>next–>next);
if((start–>data%2==0))
{printf("%d ", start–>data*3); }
else
{printf("%d ", start–>data*12); }
}
void p(struct abc** head_ref, int new_data)
{ struct abc* new_node =(struct abc*) malloc(sizeof(struct abc));
new_node–>data = new_data;
new_node–>next = (*head_ref);
(*head_ref) = new_node;
}
int main()
{ struct abc* head = NULL;
p(&head, 21);
xy1(head);
xy2(head);
getchar();
return 0;
}
Correct Answer:
441 252
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
3.0 to 5.5 Volt
Note: This Question is unanswered, help us to find answer for this one
Find the output of the following code and choose the correct answer from the given options.
#include <stdio.h>
int funct1(int num1[], int num2[], int n)
{
int x1 = 0;
int x2 = 0;
int total;
int k1 = –1, k2 = –1;
for (total = 0; total <= n; total++)
{
if (x1 == n)
{
k1 = k2;
k2 = num2[0];
break;
}
else if (x2 == n)
{
k1 = k2;
k2 = num1[0];
break;
}
if (num1[x1] < num2[x2])
{
k1 = k2;
k2 = num1[x1];
x1++;
}
else
{
k1 = k2;
k2 = num2[x2];
x2++;
}
}
return (k1 + k2)/2;
}
int main()
{
int num1[] = {22, 27, 34, 31, 39};
int num2[] = {22, 54, 67, 74, 46};
int p1 = sizeof(num1) / sizeof(num1[0]);
int p2 = sizeof(num2) / sizeof(num2[0]);
if (p1 == p2)
printf("%d", funct1(num1, num2, p1));
else
printf("failure");
return 0;
}
Correct Answer:
35
Note: This Question is unanswered, help us to find answer for this one
Which of the following options is the output of the given program?
int main( )
{
int a=8.5, f=1 ;
f = res( a ) ;
f++;
printf ( "%d", f++ ) ;
return 0;
}
res ( int x )
{
int f=1 ;
if ( x == 1 )
return ( 1 ) ;
else
f = f/4.5 + x * res ( x - 1 ) ;
return ( f++ ) ;
}
Correct Answer:
40,320
Note: This Question is unanswered, help us to find answer for this one
Choose the correct output of the following C program.
int main( )
{
int i = 3, j = 4, k, l ;
k = abc ( i, j ) ;
l = abc ( i, j ) ;
k=k+3;
l=l+3;
printf ( "%d %d", k, l ) ;
return 0;
}
abc ( int ii, int jj )
{
int kk, ll ;
kk = ii + jj+3 ;
ll = ii * jj+2 ;
return ( kk, ll ) ;
}
Correct Answer:
17, 17
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It is password-protected.
It contains control bits for configuring the RST/NMI pin.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
1
Note: This Question is unanswered, help us to find answer for this one
Choose the correct output of the following C program.
int main()
{
int i,k;
i=5;
k=abc(i);
printf("%d",k);
return 0;
}
int abc(int a)
{
int b,c,d,e;
b=6;c=9;a=a/2;
d=xyz(b);
e= d+b-(c/d)+1.5;
return(e);
}
int xyz(int w)
{
int p=1;
do
{
p=p*w;
w--;
}
while(w>0);
return(p);
}
Correct Answer:
727
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Stack
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ntohs( )
Note: This Question is unanswered, help us to find answer for this one
What is the output of the following program ?
main()
{
int u = 1, v = 3;
printf("%d %d",u,v);
funct1(&u,&v);
printf(" %d %d\n",u,v);
}
void funct1(int *pu, int *pv)
{
*pu=0;
*pv=0;
return;
}
Correct Answer:
1 3 0 0
Note: This Question is unanswered, help us to find answer for this one
Analyse the given code and answer the following question.
#include <stdio.h>
int main()
{
typedef char (*(*abc[4])())[10];
abc a1;
return 0;
}
Which of the following is true about 'a1'?
Correct Answer:
It is an array of four function pointers.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
5
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
00111100
Note: This Question is unanswered, help us to find answer for this one
This question is based upon the figure shown below
Which of the following is the post–order traversal of the binary tree that is given in the image?
Correct Answer:
O S P M T Q U R N L
Note: This Question is unanswered, help us to find answer for this one
In relation to watchdog timer modification, which of the following statements is/are correct?
i) Before changing the clock source, the WDT should be halted to avoid a possible incorrect interval.
ii) User should not change the WDT interval along with WDTCNTCL = 1 in a single instruction for avoiding an unexpected interrupt.
Correct Answer:
Only statement i) is correct.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Access to external clock is provided by TIMER interrupts.
A watchdog can be built using TIMER interrupts.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
4 bytes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
WDTISx
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A compiler always performs bounds checking on an array.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ftell()
Note: This Question is unanswered, help us to find answer for this one
Which of the following watchdog timer registers are of read/write type?
i) Watchdog timer control register
ii) Timer_A interrupt vector register
iii) SFR interrupt enable register 1
iv) SFR interrupt flag register 1
Correct Answer:
Only options i), iii) and iv).
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Timer overflow
Serial port interrupts
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
128 bytes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A pointer allows to pass variables, strings, functions, arrays, and structures as function arguments.
A pointer variable holds the value as well as the memory address of another variable.
A pointer does not allow to return structured variables from functions.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following program?
#include <stdio.h>
struct st1
{
int a;
struct st1 *ptr1 ;
};
main( )
{
struct st1 w1,w2;
w1.a = 251 ;
w2.a = 351 ;
w1.ptr1 = &w2 ;
w2.ptr1 = &w1 ;
printf ( "%d %d", w1.ptr1 –> a, w2.ptr1 –> a ) ;
}
Correct Answer:
351 251
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Data bus.
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the given program?
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
};
void ab(struct node* head)
{
if(head == NULL)
return;
ab(head–>next);
printf("%d ", head–>data*12);
}
void de(struct node* start)
{
if(start == NULL)
return;
printf("%d ", start–>data);
if(start–>next != NULL )
de(start–>next–>next);
printf("%d ", start–>data*7/6);
}
void p(struct node** head_ref, int new_data)
{
struct node* new_node =(struct node*) malloc(sizeof(struct node));
new_node–>data = new_data;
new_node–>next = (*head_ref);
(*head_ref) = new_node;
}
int main()
{
struct node* head = NULL;
p(&head, 15);
p(&head, 333);
p(&head, 31);
p(&head, 21);
p(&head, 17);
ab(head);
de(head);
getchar();
return 0;
}
Correct Answer:
180 3996 372 252 204 17 31 15 17 36 19
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
bit
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Masked ROM
Note: This Question is unanswered, help us to find answer for this one
This question is based upon the figure shown below
Choose from the given image, the correct output of the following code.
#include<stdio.h>
main ()
{
int x[3][3], y[3][3];
abc(x);
xyz(x,y);
printa(y);
}
abc(m)
int m[][3];
{
int i, j;
for(i=0;i<3;i++)
{for (j=0; j<3;j++)
{m[i][j]=((i+2) + (j+3));
}}
}
xyz(x,y)
int x[][3], y[][3];
{
int i, j;
for(i=0;i<3;i++)
for (j=0;j<3;j++)
{
y[j][i]=x[i][j];
}
}
printa(m)
int m[][3];
{
int i,j;
for(i=0;i<3;i++)
{
for (j=0; j<3;j++)
printf("%d ", m[i][j]);
printf("\n");
}
}
Correct Answer:
(4)
Note: This Question is unanswered, help us to find answer for this one
Find the output of the following program and choose the correct answer from the given options.
#include <stdio.h>
#include <malloc.h>
void abc(int num2[], int num)
{
int *c = (int *)calloc(sizeof(int), (num – 2));
int i;
printf("output: ");
for (i = 0; i < num; i++)
{
if (c[num2[i]] == 1)
printf(" %d ", num2[i]+5);
else
c[num2[i]]++;
}
}
int main()
{
int num1[] = {15, 10, 10, 2, 7, 4, 2};
int af = sizeof(num1) / sizeof(num1[0]);
abc(num1, af);
getchar();
return 0;
}
Correct Answer:
output: 15 7
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
SRAM
Note: This Question is unanswered, help us to find answer for this one
Which of the given types of memories has the following characteristics?
i) It requires a block-sized 'erase' operation before this type of memory can be programmed.
ii) It is used for the storage of a program code.
Correct Answer:
Flash ROM
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
BIS.B
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Bits 3-1
Bits 7-5
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
069h
Note: This Question is unanswered, help us to find answer for this one
What would be the output of the given C program?
int main( )
{
int a = 10, b = 20, m = 47, n = 96 ;
abc ( &a, &b ) ;
wxy ( &m, &n);
printf ( "%d, %d, %d, %d", a, b, m, n ) ;
return 0;
}
abc( int *x, int *y )
{
int t ;
t = *x ;
t = xyz();
*x = *y ;
*y = t++ ;
}
wxy(int *p, int *q)
{
*p = *p/2+9-1;
*q = *p/2+71-2;
}
xyz()
{
int t;
t = 6/2-54/3-(5.6/4);
return(t);
}
Correct Answer:
20, -16, 31, 84
Note: This Question is unanswered, help us to find answer for this one
In relation to system reset and initialization, which of the following options can trigger the Power-Up Clear (PUC) signal?
i) The Power-On Reset (POR) signal.
ii) Security key violation of a flash memory.
iii) Security key violation of a watchdog timer.
iv) Expiration of a watchdog timer when in the watchdog mode only.
Correct Answer:
All options i), ii), iii) and iv).
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Underflow
Note: This Question is unanswered, help us to find answer for this one
What would be printed on the standard output as a result of the following code snippet?
main()
{
char *pmessage = "asdfgh";
*pmessage++;
printf("%s", pmessage);
return 0;
}
Correct Answer:
sdfgh
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It will clear the count value to 0000h.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
31 and 32
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
One common memory space and one data bus.
Note: This Question is unanswered, help us to find answer for this one
Analyse the following code and choose its correct output from the given options.
#include<stdio.h>
int main()
{
int num1[9] = {3,2,3,4,5,2,3,9,2};
int *pt1, sm=0;
int a, b, p, z, n=9;
z = n;
pt1 = num1;
for (a = 0; a < z; a++)
{
for (b = 0; b < z; b++)
{
if (a == b)
{
continue;
}
else if (*(pt1 + a) == *(pt1 + b))
{
p = b;
z--;
while (p < z)
{
*(pt1 + p) = *(pt1 + p + 1);
p++;
}
b = 0;
}
}
}
for (a = 0; a < z; a++)
{
sm=sm+num1[a];
}
printf("%d",sm);
return 0;
}
Correct Answer:
23
Note: This Question is unanswered, help us to find answer for this one
Given the array:
int num[3][4]=
{
{3,6,9,12},
{15,25,30,35},
{66,77,88,99}
};
what would be the output of *(*(num+1))?
Correct Answer:
15
Note: This Question is unanswered, help us to find answer for this one
Which of the given functions will be performed by the following program?
#include <stdio.h>
void main()
{
int arr1[15];
int a, b, number1, tmp_no;
printf("Enter any value between 2 and 15\n");
scanf("%d", &number1);
printf("Enter elements\n");
for (a = 0; a < number1; a++)
{
scanf("%d", &arr1[a]);
}
for (a = 0; a < number1; a++)
{
for (b = 0; b < (number1 – a – 1); b++)
{
if (arr1[b] > arr1[b + 1])
{
tmp_no = arr1[b];
arr1[b] = arr1[b + 1];
arr1[b + 1] = tmp_no;
}
}
}
for (a = 0; a < number1; a++)
{
printf("%d\n", arr1[a]);
}
}
Correct Answer:
It will sort and print the array in the ascending order, by using the bubble sort.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Entire chip.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
0x8005
Note: This Question is unanswered, help us to find answer for this one
This question is based upon the figure shown below
The given program, which was supposed to give output as shown in the image, has some errors. Analyse the code and choose the correct line number(s) containing error(s).
1.int main( )
2.{ int i=1,j=1,k=1;
3. abc(i,j,k);
4. xyz(i,j,k);
5. return 0;
6.}
7.abc (int a, int b, int c)
8.{ for(;a<=5;a++)
9. { for(b=5;b>a;b--)
10. { printf(" "); }
11. for(c=1;c<=a;c++)
12. { printf("* "); }
13. print("\n");
14. } }
15.xyz(int *a, int *b, int *c)
16.{ for(a=4;a>=1,a--)
17. { for(b=4;b>=a;b--)
18. { printf(" "); }
19. for(c=a;c>=1;c++)
20. { printf("* "); }
21. printf("\n");
22. } }
a. 4
b. 9
c. 13
d. 14
e. 15
f. 16
g. 17
h. 19
Given the array:
int num[3][4]= {
{3,6,9,12},
{15,25,30,35},
{66,77,88,99}
};
what would be the output of *(*(num+1)+1)+1?
Correct Answer:
26
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements is/are valid and correct?
1.char amessage[] = "lmnop";
amessage++;
2.char *pmessage = "abcde";
(*pmessage)++;
3.char amessage[] = "lmnop";
(*amessage)++;
4.char *pmessage = "abcde";
pmessage++;
Correct Answer:
34
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
1
Note: This Question is unanswered, help us to find answer for this one
What function will the following code perform?
void delete_element ( node *m, int n)
{
node *p, *k;
k = search ( m, n);
if (k = = ( node *) NULL)
return;
p = k –> next;
k –>next = p –>next;
free (p);
}
Correct Answer:
It will delete the element that is next to a given element in the list.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
10
Note: This Question is unanswered, help us to find answer for this one
This question is based upon the figure shown below
Which of the given images represents a correct binary search tree, if the elements are inserted in the following order?
6, 31, 3, 41, 26, 5
Correct Answer:
1
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
IFBIT 06,[B]
Note: This Question is unanswered, help us to find answer for this one
Consider the following code.
int i = 4, *j, *k;
Which one of the following statements will not work?
Correct Answer:
j = j * 2;
Note: This Question is unanswered, help us to find answer for this one
Choose the correct methods/techniques from the following options that can be used to design algorithms.
1. Divide and conquer
2. Greedy method
3. Back tracking
4. Branch and bound
Correct Answer:
1, 2, 3 and 4
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Two or more.
Note: This Question is unanswered, help us to find answer for this one
What would be printed on the standard output as a result of the following code snippet?
char i = 'A';
char *j;
j = & i;
*j = *j + 32;
printf("%c",i);
Correct Answer:
a
Note: This Question is unanswered, help us to find answer for this one
In relation to the embedded C malloc() function, which of the following is the correct syntax for defining a header block with name hExample?
Correct Answer:
typedef struct hExample { struct hExample *ptr; unsigned int size; } HEADER;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
long int exampleVar @ _ _longIX;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
16 bits
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Bits 15-8
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NMI interrupt enable (NMIIE)
Watchdog timer interrupt enable (WDTIE)
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are correct about watchdog timers?
i) All watchdog timers can only be programmed for a single time-out delay at a time.
ii) When watchdog timers time-out, they may either reset the processor or execute an interrupt.
iii) The hardware implementation of a watchdog timer depends on the processor.
Correct Answer:
Only statements ii) and iii) are correct.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
p is an array of pointers to functions the return type of which is an integer
Note: This Question is unanswered, help us to find answer for this one
The following program is based on a recursive algorithm. Analyze the code and choose the correct output from the given options.
#include<stdio.h>
main( )
{ static int a,f;
a=5.2; f=1;
f = res( a ) ;
f++;
printf ( "%d", f++ ) ;
}
res ( int x )
{ static int f ;
if ( x == 1 )
return ( 1 ) ;
else
f = x/4.5 + x + res ( x – 1 ) + 2 ;
return ( f++ ) ;
}
Correct Answer:
25
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following program?
#include <stdio.h>
void abc(int num1[], int size)
{
int a = 0, b = size–1;
while (a < b)
{
while (num1[a] == 0 && a < b)
a++;
while (num1[b] == 1 && a < b)
b––;
if (a < b)
{
num1[a] = 0;
num1[b] = 1;
a++;
b––;
}
}
}
int main()
{
int num[] = {1, 0, 1, 0, 1, 0, 1, 1, 0};
int z = 9, x = 0;
abc(num, z);
for (x = 0; x < 9; x++)
printf("%d ", num[x]);
getchar();
return 0;
}
Correct Answer:
0 0 0 0 1 1 1 1 1
Note: This Question is unanswered, help us to find answer for this one
Fill in the blank:
A connected graph is said to be an Eulerian graph, only if all the vertices of the graph have _______ degree.
Correct Answer:
an even
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Two
Note: This Question is unanswered, help us to find answer for this one
Embedded C MCQs | Topic-wise