C++ Program to Reverse All the Strings Stored in an Array

Here you will get C++ program to reverse all the strings stored in an array. #include<iostream> #include<string.h> #include<stdio.h> using namespace std; int main() { char a[3][50]; int i,j,k,len; cout<<“Enter 3 strings:\n”; for(i=0;i<3;i++) { gets(a[i]); } cout<<“\nThe list of orignal strings:\n” ; for(i=0;i<3;i++) { cout<<a[i]<<“\n”; } cout<<“\nThe list of changed strings:\n”; for(i=0;i<3;i++) { len=strlen(a[i]); for(j=0,k=len-1;k>=0;j++,k–) { …

C++ Program to Reverse All the Strings Stored in an Array Read More »

C++ Program to Check String is Palindrome or not

Here you will get C++ program to check string is palindrome or not. A string is called palindrome if it is equal to its reverse. For example bob is string palindrome. #include<iostream> using namespace std; int main() { int i,j,len,flag=1; char a[20]; cout<<“Enter a string:”; cin>>a; for(len=0;a[len]!=’\0′;++len); for(i=0,j=len-1;i<len/2;++i,–j) { if(a[j]!=a[i]) flag=0; } if(flag==1) cout<<“\nThe string …

C++ Program to Check String is Palindrome or not Read More »

C++ Program to Find Compound Interest

Here you will get a C++ program to find compound interest. The formula used to calculate compound interest is given below: Image Source Output: Enter Principle, Rate and Time:100024Compound Interest = 82.43

Convert Binary to Decimal in C++

Here you will learn how to convert binary to decimal in C++. We can convert a binary number into decimals in the following way. Also Read: Convert Decimal to Binary in C++ C++ Program to Convert Binary to Decimal Output: Enter any Binary number:111The Decimal conversion of 111 is 7