Assignment4Ch4ArrayandStringpdf 2024 09-30-13!16!17
Assignment4Ch4ArrayandStringpdf 2024 09-30-13!16!17
Assignment 4
(Chapter – 4: Array and String)
f. In switch statement, cases and default clause may occur in any order.
a. What are the different ways to initialize an array with all elements as zero?
b. What will be output of the following C code where we copy an array ‘a’ into
array ‘b’ and then the array ‘b’ into ‘a’?
#include<stdio.h>
#include<string.h>
void main ()
strcpy(b, a);
strcpy(a, b);
i. hello, hello
a = "Hello";
i. 1
iii. 0
i. conio.h
ii. strings.h
iii. string.h
iv. stdio.h
i. 30
ii. 15
iii. 4
iv. 60
3. What is an array? Explain with Example. What are the advantages of using an
array? [U]
10. WAP input a string and check whether the inputted string is palindrome or not.
[A]