Question

Write interactive C programs to perform the following on strings: 
(a) To find the length of a given string without using the string library functions.
(b) To compare two strings without using string library functions.
(c)To count the total number of vowels and consonants in a string and display the counts
separately.

07 Aug 2023
Answer :
Word Count : 923

I'd be happy to help you with these C programs! Below are the interactive C programs to achieve the tasks you mentioned:


#include <stdio.h>

// Function to find the length of a string
int findStringLength(const char *str) {
    int length = 0;
    while (*str != '\0') {
        length++;
        str++;
    }
    return length;
}

// Function to compare two strings
int compareStrings(const char *str1, const char *str2) {
    while (*str1 != '\0' && *str2 != '\0') {
        if (*str1 != *str2) {
            return 0; // Strings are not equal
        }
        str1++;
        str2++;
    }
    // Check if both strings have reached the end
    return (*str1 == '\0' && *str2 == '\0');
}

// Function to count vowels and consonants ________ ______ ____ ______ _____ _______ _____.
______ _______ _____ _____ ___.
_____ ______ _________ ________ ____.
______ _______ ____ ___ ___ ________.
____ ______ _____ ________ _________ ___ _________ __________ __________ ___.
_________ _________ ________ ______ _______ ________ ______.
_______ ______ _______ __________ ___ _________ _______ ___ ________ ______ __________.
______ ____ ___ ______ _______ _____ _____ ______ ___ __________ _____.
_____ ______ ___ _______ _________ ___ _______.
________ _______ _________ ________ ______ ___ ____ _______ _____ _________.
______ _________ _________ ________ _________ _____ ____ __________.
______ _____ __________ ___ __________ ________ _____ _______ _______ ___.
_______ __________ _____ ______ _____ _____.
______ _______ _____ __________ __________.
____ _____ ___ ___ _________ ______ ___ _________ _________ _______.
____ _______ ______ ___ _________ ______ __________ ______ ________ ____.
________ _______ ________ ___ ____ ___ ____.
_______ _________ ________ ___ _______ ______ _______ ______ _______.
______ ______ __________ __________ _______ ______ _______ ___ __________.
________ _____ ____ _______ __________ ________ ___ ____.
_______ _______ _____ ___ __________ ____ _________ _____ _______.
__________ _____ ____ ____ ______.
______ _________ _________ _________ ___ ______.
__________ ______ ______ _____ _____ _______ _____ ___ ______.
________ __________ _______ ________ _______ __________ _______ _______ _____ _________ ___ ___.
__________ ____ ___ ________ _________ ___ ________ ________ __________.
_______ ___ ______ ______ ______.
________ ___ __________ ________ ____ _______ ____ ___.
___ ____ __________ ___ __________ ___ ________ ________ ___ _____ ___.
___ _______ _________ ___ ______ ___.
_____ ______ __________ ________ ______ ___ ________ ________ __________ _________.
_______ _________ ________ _________ ___.
___ ________ ______ ____ _______ _______ ______ _________.
______ _______ ___ ________ ___.
_______ ________ ________ ______ _____ ________ _______ _________ _____ __________ _____ _____.
_______ ___ ___ _______ ____ ______.
______ _____ ______ ________ _____.
________ _________ _____ _________ _______ _________ ____ ________ __________ ______ ____.
________ ____ _______ _______ ________.
___ __________ ___ ______ _________ ______ ______ ______ _______ ___.
_______ __________ __________ _________ ___.
________ ________ _____ _________ ___ _________ _________ ________ _________ _______ ______ __________.
___ __________ _______ _______ __________ _____ ____ _________ __________ _____ ____.
_______ ______ _______ ________ ___ ________ _______ __________ ____ _____ _____ _______.
_________ ________ __________ _____ _____ _____ __________.
_____ ______ ____ ____ ______ _________ ____.
____ ______ ____ ____ ____.
____ ________ _______ _____ _____ _______.
_______ _____ _________ ________ ________ ___ _____ _________ __________ _____ __________ __________.
__________ _________ ________ __________ ____ _________ _______ ________ ____ _____.
_______ _____ __________ __________ ____ _____ ____ ___ _____ _________ ______ ________.
_______ _____ _____ _________ __________ _______ _______ _________ _________.
________ ____ ____ _______ ______ ________ ____ ______.
_________ ____ ___ _________ ___ _______ _________ _________ ________ _____.
________ __________ _____ ___ ______ ________ _______ ______ ____ _________ ________.
______ ____ _____ _____ ____ ______.
________ ________ _____ ______ ________ ___ _____ _____ _____.
________ ___ ___ ______ ______ ______ ____ ____ ____.
____ _________ ____ ___ _______ ____ ______ ___.
_________ _____ ______ ____ _____ ________.
________ _________ _____ ____ _______ ______ ______ _________.
________ _____ _____ _________ _____ _________ ______ ______ ________ ______.
_________ __________ _____ ____ ________ _______ _______ __________ _______.
______ _____ _______ ___ ______ __________ ____ ___ ________ __________.
________ _____ ___ __________ _________ ____ ________ _______ ________ ____.
________ ___ __________ __________ ____ ____ ___ ________ ________ ____ ________ _________.
____ ________ ________ _______ _____ _____ _________ ___.
____ ______ _____ _____ ________ ________ ____ _________ _____ __________ ___.
______ ____ __________ _________ ________ _______ ______ ___ ____.
__________ _______ _______ _____ ____ _____ ____.
_______ _________ __________ _____ __________ ___ ___ _______ ___ _______ _______.
_________ ______ ______ ___ _______ ______ __________ _____ _________ _____.
__________ _______ ________ ___ _______ _______ ______ ________ __________.
___ ___ ______ __________ __________ _________.
___ ________ _________ ________ __________ _______ _____ ___ ___ ______ _________.
______ _____ _______ ___ ____ ______ _________.
____ _______ _________ _______ ____ _______ ___ __________ ____ __________ __________ __________.
____ ____ __________ _____ ________ ________ _________ __________ ________ __________ __________.
____ _______ _____ ______ ________ ______ __________ ____ _________ ______ _________ ____.
______ ______ _____ _____ _________.
________ _____ ____ ______ _____ _________ __________ _____ _______.
________ ______ _____ _____ _____ ______ ______.
_________ ______ __________ ________ _______ __________ _____ ____ __________ _______ _______.
______ ___ _________ __________ ____ ________ _______ __________.
_______ ___ ________ ______ _________ _________ ___ __________ __________ _________.
____ _______ ________ __________ _________ ________ ___ _________ ____ __________.
__________ ___ ________.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write interactive C programs to perform the following on strings:&nbsp
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→