Tag Archives: return

Write a program to do linear search for an integer in 20 distinct numbers. The program should return the location of an element – IGNOU BCA Assignment 2015 – 16

BACHELOR OF COMPUTER APPLICATIONS Course Code : BCSL-045 Course Title : Introduction to Algorithm Design Lab Assignment Number : BCA(IV)/L-045/Assignment/2015 Maximum Marks : 50 Weightage : 25% Write a program to do linear search for an integer number in an array of 20 distinct numbers. The program should return the location of an element if… Read More »

Explain the meaning of each of the following functions prototypes and mention the return data type of each of them: 10m Jun2006

Explain the meaning of each of the following functions prototypes and mention the return data type of each of them: 10m Jun2006   (i) double f(double a, int b);  –   This function has two arguments, first of double data type and second of int data type. The return data type is double.   (ii) void… Read More »

C029 A C program with a function that returns the minimum and the maximum value in an array of integers

void minmax(int array[],int length,int *min,int *max); //prototype Let’s identify variables needed for this program. In this program, we need several variables to store array of decimal numbers and count the length of array and store minimum and maximum of the array. First variable will be the one which will save the list of integers in… Read More »

C028 A C program with a function that will return the length of a character string without using inbuilt function

Let’s identify variables needed for this program. In this program, we need several variables to store string and count the number of characters in the given string. First variable will be the one which will save the string entered by the user and it will be S[50]. In C language we do not have string… Read More »

C012 A C program that uses macros, MIN & MAX, to find and return, respectively the minimum & maximum of two values

Macro are the small code which is substituted wherever the macro is refered. macros can be used in two ways : First way as a replacement to the code which is long in length or repeated all the time.  e.g. #define CUBE(X) (X*X*X) Second way as a small function in which we can pass arguments… Read More »