Program for finding out PALINDROME of a string in c++

Program for finding out PALINDROME of a string in c++

Description In this program first and last characters of string is compared one by one moving towards centre. Here string is entered in the variable ‘st’ of type String by user. Now…

Creating a Simple-Reverse Triangle in C++

Creating a Simple-Reverse Triangle in C++

Logic Used –> j=i-1 –> j=2*(n-i)+1

Creating a Diamond Pattern in Java

Creating a Diamond Pattern in Java

Logic Used –> j=2*(n-i)+1 –> j=i

Program to print the word in newline whenever the “whitespace” is encountered in a given string in Java (2 Methods)

Program to print the word in newline whenever the “whitespace” is encountered in a given string in Java (2 Methods)

Description  

Creating a Reverse Scalene Triangle Pattern in Java

Creating a Reverse Scalene Triangle Pattern in Java

Logic Used –> j=n-i –> j=n-i+1

Creating a Upper-Lower Pointed Triangle in Java

Creating a Upper-Lower Pointed Triangle in Java

Logic Used –> n=n/2+1 –> j=i-1 –> j=2*(n-i)+1 –> j=n-i –> j=2*i-1

Creating a Right Pointer Pattern of Star in C++

Creating a Right Pointer Pattern of Star in C++

Logic Used –> n– (to make it odd) –> n=(n/2)+1 –> j=i –> j=n-i

Use of cout pre-defined function in C++

Use of cout pre-defined function in C++

Description cout is a predefined function.   As you know C++ is more advanced than C, therefore in C++ there is already a predefined function known as cout which is used to display…

Program to Implement Linear Search in 1D array in C

Program to Implement Linear Search in 1D array in C

Description Linear Search is also known as sequential search. Here the array of integers are entered in the array ‘arr[]’. Variable ‘x’ is used to store the element to be…

Use of printf() function in C

Use of printf() function in C

Description printf() is a built-in function. C does not contain any instruction to display output on screen rather it uses a readymade libraty function printf() to achieve it. For us…


1 2 3 6 7