Cie 1 Icp Modified2
Cie 1 Icp Modified2
Cie 1 Icp Modified2
E Which keyword is used to transfer control from a function back to the calling function?
a. return b. goback c. goto d. switch
Q. 2 Write a C program to reverse the element of an integer 1-D array using function. 8
Q. 3 Given two arrays of integers A and B of sizes M and N respectively. Write a function 8
named MIX () with two arguments, which will produce a third array named C. such that
the following sequence is followed.
All even numbers of A from left to right are copied into C from left to right.
All odd numbers of A from left to right are copied into C from right to left.
All even numbers of B from left to right are copied into C from left to right.
All old numbers of B from left to right are copied into C from right to left.
A, B and C are passed as arguments to MIX (). e.g., A is {3, 2, 1, 7, 6, 3} and B is {9, 3, 5, 6,
2, 8, 10} the resultant array C is {2, 6, 6, 2, 8, 10, 5, 3, 9, 3, 7, 1, 3}
Q. 4 What is the purpose of the following program. Find the output of the 5
program if the input sentence is “Vishwakarma University”
#include <stdio.h>
#include <conio.h>
int main()
{
char str[1000];
int i=0, count=1;
clrscr();
printf("\n Enter the sentence: ");
gets(str);
while(str[i] != '\0')
{
if(str[i] == ' ' && str[i+1] != ' ')
count++;
i++;
}
printf("\n The total count of words is: %d", count);
return(0);
}
Q. 5 5