You are on page 1of 2

Chaitanya Bharathi Institute of Technology (A), Hyderabad-500075

Max Marks: 5 SLIP TEST-2 Date: 14/03/2022


Roll No: Name: Section:____IT-2_____

1. What is the default return type of the function if it is not specified in


function definition? [ CO4][BL1 ]
Ans:
2. A function prototype is used for----------------------------------[ CO4][BL1 ]
Ans:
3. An integer array of size 10 is declared in a C program. The memory
location of the first byte of the array is 1000. What will be the location of
the 7th element of the array? (For example if integer takes 2 bytes of
memory) [CO5 ][ BL2]
Ans:
4. In C language the last character of a string is------------------[CO5 ][ BL1]
Ans:
5. What is the disadvantage of linear search? [CO5 ][BL2 ]
Ans:
6. What is the default storage class of the local variable? [CO4 ][BL1 ]
Ans:

7. What will be the output? [ CO5][ BL2]

#include<stdio.h>
#include<string.h>
int main()
{
char str1[20] = "hello", str2[20] = " world";
printf("%s", strcpy(str2, strcat(str1, str2)));
return 0;
}

Ans:

8. To get the output as “Hwi orea”, what should be the condition


inside the ‘if’ statement? [CO5][ BL2]

#include<stdio.h>
int main()
{
int i;
char s[] = "How is your exam";
for(i = 0; s[i]!= '\0'; ++i)
{
if(_______)
printf("%c", s[i]);
}
return 0;
}
Ans:
9. What will be the output of the following code? [CO5][BL2]

# include <stdio.h>
int main()
{
char str1[] = "Week-7-Assignment";
char str2[] = {'W', 'e', 'e', 'k', '-', '7', '-', 'A', 's','s','i','g','n','m','e','n','t'};
int n1 = sizeof(str1)/sizeof(str1[0]);
int n2 = sizeof(str2)/sizeof(str2[0]);
printf("n1 = %d, n2 = %d", n1, n2);
return 0;
}
Ans:
10. [CO5][BL2]

Ans:

You might also like