Practical work
1. Write a C program to find length of a string using loop. How to find length of a string without using in-built library function strlen()in C programming. Effective way to find length of a string without using strlen() function. How to find length of a string using strlen() string function.
Example
Input
Input string: I love programming.
Output
Length of string: 38
2. Write a C program to copy one string to another string using loop. C program to copy one string to another without using inbuilt library function strcpy(). How to copy one string to another without using inbuilt string library function in C programming. Effective logic to copy strings in C programming. How to copy one string to another string using strcpy() function in C program.
Example
Input
Input string: I love programming.
Output
Original string: I love programming.
Copied string: I love programming.
3. Write a C program to convert string from lowercase to uppercase string using loop. How to convert string from lowercase to uppercase using for loop in C programming. C program to convert lowercase to uppercase string using strupr() string function.
Example
Input
Input string: I love programming.
Output
I LOVE PROGRAMMING.
4. Write a C program to compare two strings using loop character by character. How to compare two strings without using inbuilt library function strcmp() in C programming. Comparing two strings lexicographically without using string library functions. How to compare two strings using strcmp() library function.
Example
Input
Input string1: Learn programming
Input string2: Learn programming
Output
Both strings are lexographically equal.
Материалы на данной страницы взяты из открытых источников либо размещены пользователем в соответствии с договором-офертой сайта. Вы можете сообщить о нарушении.