Terry E Snyder Jr
&  
RemoteWebs.com  

Computer & Web Solutions

Support, Design, and more...
| | |
December 23rd, 2024 1:31:47 PM

C Programming Final

1.	Examine the function definition and spot any syntax problems. Explain in detail the source of any errors.
	int myabs(int a)
	{	if (a >=0)
		{	return(a); };
		else
		{	return(-a); };
	}
2.	Is the following a valid code section on C? (Hint ... are code sections not displayed.)
	while (...)
		while (...)
		{
			...
			for(...)
			{
				...
				if (/* something wrong */) goto error;
				...
			}
		}
	...
	error: /* take care of errors here */
3.	Place the following elements in a binary tree so that the tree sorts from lowest on left and higest on right. {d,q,h,r,o,w,h,a,w,j,p,b}, Draw tree, write the post order printout function of the tree.
4.	Write the preorder function to the problem above and write the in order function to the problem above.
5.	Write the power function ax both Itertively and recursive.
6.	What is the name of ->?
	a.	Structure member operator
	b.	Structure pointer operator
	c.	Indirection operator
	d.	Preprocessor operator
7.	What is the name of this * when used for a function declaration or prototyping?
	a.	Structure member operator
	b.	Structure pointer operator
	c.	Indirection operator
	d.	Preprocessor operator
8.	scanf requires what when inputting values into variables?
	a.	Variables
	b.	Memory address of variables
	c.	Pointers
	d.	Memory locations of int
9.	By standard ANSI C the end of a string should end with what?
	a.	\1
	b.	\n
	c.	\0
	d.	\l
10.	sizeof is what?
	a.	Variable
	b.	Function
	c.	Operator
	d.	Preprocessor
11.	What does a void function return
	a.	Nothing
	b.	What is it told to return
	c.	Numbers
	d.	a & b
12.	Which function(s) creates dynamic memory?
	a.	calloc()
	b.	malloc()
	c.	memalloc()
	d.	a & b
13.	Which of the following is not a basic scanf conversion character?
	a.	u
	b.	c
	c.	o
	d.	j
14.	Which of the following is not a basic printf conversion character?
	a.	d
	b.	s
	c.	z
	d.	E
15.	This for(;;) {...} is defined as.
	a.	Loop
	b.	Infinite loop
	c.	Recursive call
	d.	Nothing
16.	Which is not a method of looping in C.
	a.	for
	b.	while
	c.	do
	d.	loop
17.	What is needed for the creation of a file pointer?
	a.	File
	b.	FILE
	c.	Int *file
	d.	Freopen18.	Which of the following is not a mode for working with files in C?
	a.	R
	b.	r+
	c.	w
	d.	a
19.	Is the fclose function needed to end a program that uses files in a C program?
	a.	Yes
	b.	No
20.	Which is not a logical operator in C?
	a.	==
	b.	&
	c.	<=
	d.	!=
21.	Write a program to compare two files holding integer numbers, and print the first line where they differ.
22.	Write a program to read a file holding integers and sort the integers.  A function void bsort(int *array, int *size) is already defined for you.
23.	Write a function that will compare two strings and return zero if the two strings are the same return negative number if the first string is less than the second string and return positive number if the first string is greater than the second string.
24.	Define a macro swap(x,y) where the x and y values are swapped.
Google
 
Web www.terryesnyderjr.com
www.remotewebs.com

Page Updated on August 23, 2020 22:47

www.terryesnyderjr.com Copyright 2000-2024©