Description
You must demo all your work during your lab session and before exiting the lab. And submit the lab work in the blackboard.
Programs:
- Write a short C program that counts number of vowels and consonants in a string using pointers. Use of pointers is a must.
Enter String = coding
vowel = 2
consonant = 4
- Write a C program to find the smallest and largest word in a sentence. You can use string functions like strlen, strcpy, strcmp in your program.
Enter a sentence
This is a program to find smallest and largest word
largest word is smallest
smallest word is a
- Write a C program to sort strings in dictionary order. You can ask the user to enter names and then sort them using string functions like strcpy, strcmp.
Enter 5 names
John
William
James7
Frank
Robert
*****************************
String in discionary order:
Frank Jmaes
John
Robert
William
Write pseudocode to solve the given problems.
Write C program to solve the above problems. Name your file Lab8_YourName.c