Showing posts with label String. Show all posts
Showing posts with label String. Show all posts

C++ Program to Find Length of a String

How to write a Program to find length of a string in C++ Programming ?


C++ Program to Find the Length of a String C++ Program to find string length c++ - calculate length of a string without using standard  String length - C, C++ and Java programming tutorials C Program to Find Length of String Without using Library ... program to find the length of the string manually - C / C++ C++ Programming Program to Calculate Length of a String Program to Calculate Length of a String c++ program to find length of string without using strlen function c++ program to find length of string using pointers program to find length of string in 8086 program to find length of string in java without using length method program to find length of string without using library function in c# how to calculate length of string in c++
C++ Program to Find Length of a String


Solution:
//Program to find length of a string.
#include<conio.h>
#include<iostream.h>
#include<stdio.h>

void main()
{
clrscr();
char a[80];
cout<<"Enter a string: ";
gets(a);
for(int i=0;a[i]!='\0';i++);
cout<<"The length of the string is: "<<i;
getch();
}

This C++ Program to Find Length of a String.

C++ Program to display a string reversed

How to write a C++ Program to display a string reversed in C++ Programming ?

Search Results Write ac program to reverse a string - C programming  Search Results C++ Program to reverse a string C++ - How To Reverse A String How to Reverse string in c++ simple program C++ Strings - Programming Questions Write A C++ Program To Reverse A String. Reverse a string - C++  Reverse a String in C++  Display A String Backwards - C And C++ c++ - Loop to print string backwards C, C++ Program to Reverse a String without using C++ Program to display a string reversed. c++ program to reverse a string without using string functions c++ program to reverse a string using for loop c++ program to reverse a string using pointers c++ program to reverse a string using array c++ program to reverse a string using recursion c++ program to reverse a string using strrev c++ program to reverse a string using stack c++ program to reverse a string without using another array
C++ Program to display a string reversed


Solution:
//Program to display a string reversed.
#include<conio.h>
#include<iostream.h>
#include<stdio.h>

void main()
{
clrscr();
char a[80];
cout<<"Enter a string: ";
gets(a);
for(int i=0;a[i]!='\0';i++);
for(int j=i;j>=0;j--)
cout<<a[j];
getch();
}

This C++ Program to display a string reversed.

C++ Program to check if two strings are identical.

How to write a C++ Program to check if two strings are identical or not in C++ Programming ?



C++ Program to check if two strings are identical. How to compare two strings in C++ How to Compare Two Strings in C++ Programming  Check if sizes of two strings are same Check whether two strings are anagram of each other
C++ Program to check if two strings are identical.

Solution:
//Program to check if two strings are identical.
#include<conio.h>
#include<iostream.h>
#include<stdio.h>
#include<string.h>

int main()
{
clrscr();
char a[80],b[80];
int z=0;
cout<<"Enter a string: ";
gets(a);
cout<<"Enter another string: ";
gets(b);
if(strlen(a)!=strlen(b))
cout<<"The strings are not identical.";
for(int i=0;a[i]!='\0';i++)
if(a[i]==b[i])
++z;
if(z==strlen(a))
cout<<"The strings are identical.";
else
cout<<"The strings are not identical.";
getch();
}

This C++ Program to check if two strings are identical.

C++ Program to check if a string is palindrome.

How to write a Program to check if a string is palindrome in C++ Programming ?

C++ Program to check whether a String is Palindrome or not C++ Program to Check Whether String is Palindrome Program to check a string is palindrome or not - C++ Tutorial C++ Program to check whether a string is PALINDROME Write a c++ program to check whether a string is a palindrom A program to check for palindromes for C++ Code Example C++ program to check whether the given string is Program:To check if a string is a palindrome or not c++ - Check if a string is palindrome palindrome program  c program to check if a string is palindrome using pointers c program to check if a string is palindrome or not check if string is palindrome java check if string is palindrome using recursion check if string is palindrome python check if string is palindrome using stack check if string is palindrome geeksforgeeks
C++ Program to check if a string is palindrome.



Solution:
//Program to check if a string is palindrome.
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
void main()
{
clrscr();
char a[80];
int z=1;
cout<<"Enter a string: ";
gets(a);
int n=strlen(a);
for(int i=0,j=n-1;i<=(n-1)/2;i++,j--)
{
if(a[i]!=a[j])
{
z=0;
break;
}
}
if(z==0)
cout<<"The string is not palindrome.";
else
cout<<"The string is palinrome.";
getch();
}

This C++ Program to check if a string is palindrome.

C++ Program to toggle case of letters of a String

How to write C++ Program to toggle case of letters of a string in C++ programming language ?

C++ Program to toggle case of letters of a String


Solution:
//Program to toggle case of letters of a string.
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
void main()
{
clrscr();
char a[80];
cout<<"Enter a string: ";
gets(a);
for(int i=0;a[i]!='\0';i++)
{
if(isupper(a[i]))
a[i]=tolower(a[i]);
else
a[i]=toupper(a[i]);
}
puts(a);
getch();
}

This C++ Program to toggle case of letters of a String.

C++ Program To Find Out Number Of Vowels In A String

How to write a C++ Program to find out number of vowels in a string in C++ programming ?

Program To Find Out Number Of Vowels In A Atring C Program to Find the Number of Vowels, Consonants, Digits To count the number of vowels in a given string  C Program to Count the Number of Vowels & Consonants c program to count vowels in a string Program to find total vowels in the string C Program to count number of vowels in a string This C program counts the number of vowels in a string using for loop. The string is input by the user. Count number of vowels, consonants and digits in a String Write a c++ program that finds the number of vowels used in C++ program: count the number of vowels in a string .. In this program ill teach you how to count the number of vowels in a string that the user inputs.
C++ Program To Find Out Number Of Vowels In A Atring


Solution:
//Program to find out number of vowels in a string.
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
void main()
{
clrscr();
char a[80];
int n=0;
cout<<"Enter a string: ";
gets(a);
for(int i=0;a[i]!='\0';i++)
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u')
++n;
cout<<"Number of vowels in the string: "<<n;
getch();
}

This C++ Program To Find Out Number Of Vowels In A Atring.