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

CIE 2 ICP Set2

This document contains 6 multiple choice and short answer questions about C programming concepts such as arrays, strings, functions and recursion. It tests knowledge of basic syntax and capabilities of the C language.
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)
20 views2 pages

CIE 2 ICP Set2

This document contains 6 multiple choice and short answer questions about C programming concepts such as arrays, strings, functions and recursion. It tests knowledge of basic syntax and capabilities of the C language.
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
You are on page 1/ 2

Vishwakarma University

Science and Technology


CIE-II
SET-II
Class: FY BTech Course: Computer Engineering
Subject: ICP (BTECHCS18106) Max. Marks: 30
Date: 12thOctober 2018 Duration: 1 hour
1. Attempt all questions
2. Figures to the right indicate full marks.
3. Steps of hand running of the program must be shown wherever output of the program is asked.

Q. 1 Choose appropriate option from the following 1x5


A Maximum number of elements in the array declaration int a[5][8] is ----
A] 28 B] 32 C] 35 D] 40
B Array subscripts in C always start at
A ] -1 B] 1 C] 0 D] Value provided by user
C Array elements are always stored in -------- memory locations
A. Sequential B. Random C. Random and Sequential D. None of the above
D What is the built-in library function for comparing the two strings?
a. strcmp() b. equals() c. str_compare() d. string_cmp()

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 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];
inti=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. 4 Given two arrays of integers A and B of sizes M and N respectively. Write a function named 8
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. 5 Find the output of the following program as displayed on the screen 4
main()
{
Int p,f;
p=23; f=24;
p=packman(p,f);
printf(“p=%d f=%d”,p,f);
}
packman(int q,int h)
{
q=q+q;
h=h+h;
return(q);
return(h);
}
OR

Q. 6 Write a program in C to check whether a given string is a palindrome 4


or not?

You might also like