Replace every letter with its adjacent letter and convert all vowels to uppercase.

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.

[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++][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)