C++ #include<iostream> using namespace std; bool isAlphabet(char c) { if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) return true; return false; } bool isVowel(char c) { char vowels[] = {'a', 'e', 'i', 'o', 'u'}; for (char vowel : vowels) { if (vowel == c) { return true; … Continue reading Replace every letter with its adjacent letter and convert all vowels to uppercase.
Category: C++
C++ Code
[C++]Eucliden GCD Finding
#include <iostream> using namespace std; int GCD(int a,int b){ if(a==0) return b; else if(b==0) return a; return GCD(b,a%b); } int main() { cout<<GCD(270,192); return 0; }
[Pattern][C++] A pattern program
Happy to be here again, Recently i was given a Pattern Problem to solve by my friend, who attended an interview where they were asked to Write its solution. So it goes like this-
[C++] Palindrome using Recursion
#include <iostream> using namespace std; bool Palindrome(string s,int start,int end){ if(s[start]!=s[end]) return false; if(start!=end) return (s,start+1,end-1); return true; } int main() { string s; cin>>s; cout<<(Palindrome(s,0,s.length()-1)?"yes":"No"); return 0; }
[C++]Calling main() Recursively
#include <iostream> using namespace std; static int i=5; int main() { cout<<i--<<endl; if (i!=0) main(); return 0; }
[C++][Problem] Find 2 Missing Numbers in a Range
// Created by Dinesh Solanki on 04-02-2019. #include <iostream> using namespace std; int firstNo,secondNo; int sum=0,missSum = 0,sumLessAvg = 0,sumGreatAvg = 0,avg,sumTillAvg = 0; void read(int n,int length) { int c; cin>>c; sum=sum+c; if (length > 1) { read(n,length-1); } missSum = (n*(n+1)/2)-sum; avg = missSum/2; if(c <= avg) sumLessAvg += c; else sumGreatAvg+=c; sumTillAvg … Continue reading [C++][Problem] Find 2 Missing Numbers in a Range
[C++]Print A line in reverse with recursion and without an array
/* Name: Print A line in reverse with recursion and without array Author: Dinesh Solanki Date: 27-09-18 19:02 */ #include<iostream> using namespace std; void reverse() { char c; c = getchar(); if (c != EOF) { reverse(); cout << c; } } int main() { reverse(); return 0; }
[C++][Problem] Print Diamond Pattern (Hollow Inside)
#include <iostream> using namespace std; int main() { int n,i,j,k; cin>>n; //Print upper Half for(i=0;i<n;i++) { for(k=i;k<n;k++) //Print Space cout<<" "; for(j=0;j<=i*2;j++) { if(j==0 || j==(i*2)) //Condition to print only Boundary cout<<"*"; else cout<<" "; } cout<<endl; } //Print Lower Half for(i=n;i>=0;i--) { for(k=n;k>i;k--) //Print Space cout<<" "; for(j=0;j<=(i*2);j++) { if (j == 0 || … Continue reading [C++][Problem] Print Diamond Pattern (Hollow Inside)
[c++][Problems] Window Problem
Hey there!, its been quite for a while, hasn't it?. well i got something, So my Professor gave me a Problem to solve Today, i thought you might find it interesting too, my solution is in C++, yours can be in any language, tell everyone in the comment, if you find another solution. The Problem … Continue reading [c++][Problems] Window Problem
[C++]QuickSort Array
QuickSort Program to Sort an Array in C++.

