CP Lab -7 [String Based Question]

Post date: Nov 27, 2017 11:20:50 AM

1. Write a C Program to find the length of the string using loop control and print the length of the string.

2. Write a C Program to get two string inputs from the user. Compare the two strings using string function and print strings are equal or not.

3. Write a C program using function that takes a character indicating a color as an input argument and displays the full color if it is present else prints the message that the color is not present. Here function doesn't return anything. Rainbow colors:

R O Y G B I V = Red Orange Yellow Green Blue Indigo Violet

4. Write a C program to accept first name, middle name and last name from user, store them in 3 different character arrays. Concatenate these 3 strings in one and print as full name.

5. Write a C program using math functions to perform the following (include math.h file and use pow(a,b) math function)

(A(b+1)) + (A(b+2)) + (A(b+3))

Compile your program using cc file.c –lm