0% found this document useful (0 votes)
73 views2 pages

Data Structure Test Questions

This document contains 3 programming questions: 1) A C program that uses a static variable and counter function. The question asks for the output. 2) A C program that uses a 2D array and pointer to an array. The question asks for the output. 3) A C program that uses recursion and a void function to decrement and print a number. The question asks for the output. The document also includes links to exercises on stacks and queues and a question to write a function to check if a character is a vowel.

Uploaded by

Luz Bristán.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views2 pages

Data Structure Test Questions

This document contains 3 programming questions: 1) A C program that uses a static variable and counter function. The question asks for the output. 2) A C program that uses a 2D array and pointer to an array. The question asks for the output. 3) A C program that uses recursion and a void function to decrement and print a number. The question asks for the output. The document also includes links to exercises on stacks and queues and a question to write a function to check if a character is a vowel.

Uploaded by

Luz Bristán.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

[Título del documento]

DATA STRUCTURE
TEST 1
e(--n);
Consider the following program: printf("%d ", n);
e(--n);
(45 pts) }
}
#include <stdio.h>

int counter(int i)
What is the output of this program?
{
static int count = 0; A. 0120
count = count + i;
return count; B. 0121
} C. 1201
int main(void) D. 0211
{
int i, j;
Consider the following program:
for (i = 0; i <= 5; i++)
j = counter(i); #include <stdio.h>
printf("%d\n", j); int main(void)
return 0; {
} int a[][3] = {1, 2, 3, 4, 5,
6};
int (*ptr)[3] = a;
What is the output of this program?
printf("%d %d ", (*ptr)[1],
(*ptr)[2]);
A. 10
B. 15 ++ptr;
printf("%d %d\n", (*ptr)[1],
C. 6 (*ptr)[2]);
D. 7
return 0;
}
Consider the following program:
#include <stdio.h>
What is the output of this program?
void e(int); A. 2356
int main(void) B. 2345
{ C. 4500
int a = 3;
e(a); D. none of the above
putchar('\n');
return 0;
}

void e(int n)
{
if (n > 0)
{

pág. 1 Ing. María de los Ángeles Morales


[Título del documento]

II. Anser the question in the scheduled exercise (25 pts)

https://www.daypo.com/lista-pilas-colas.html
Write the score: / 25

III. Write a Vocal logic function that determines if a character is a vowel


(30 pts)

pág. 2 Ing. María de los Ángeles Morales

You might also like