Assignment7 July 2024
Assignment7 July 2024
Assignment7 July 2024
Solution: (c) Address of the first element of the array or the base address of the array.
Solution: (d) For all of the above cases, multi-dimensional arrays are used.
a) n1=18, n2=17
b) n1=18, n2=18
c) n1=17, n1=17
d) n1=17, n2=18
a) assignment
b) tnemngissa
c) nothing will be printed
d) tttttttttt
Solution: (c) nothing will be printed as the string termination character ‘\0’ is assigned to first element of
array p[].
Problem Solving through Programming in C
Week 07 Assignment Solution
Solution: 321004
In a[2][3] = {1, 2, 3, 4}; only 4 values are given. The rest will be taken as 0. So, finally a[2][3] = {{1, 2,
3}, {4,0,0}}; So, 321004 will be printed as per the given for loop.
#include<stdio.h>
#include<string.h>
int main()
{
char str1[20] = "hello", str2[20] = " world";
printf("%s", strcpy(str2, strcat(str1, str2)));
return 0;
}
a) hello
b) world
c) world hello
d) hello world
a) Programming
b) PROGRAMMING LANGUAGE
c) PROGRAMMING
d) Syntax error
Solution: (c) While loop is executed till the space between the words. toupper() will convert the lower case
letter to upper case. Thus, PROGRAMMING will be the output.
Problem Solving through Programming in C
Week 07 Assignment Solution