Java Program to Print Pyramid Pattern or Star Pattern Here is our Java program to draw the pyramid pattern as shown in the problem statement. In this program, we have two examples of printing pyramids, in the first, we have a printed pyramid of star characters, while, in the second exampl...
Count number of words in a string Java Program to Check Whether a Character is Alphabet or Not Java Program to check a Character is Vowel or Consonant Convert celsius to fahrenheit in java Java program to count number of words in sentence Print pyramid pattern: 1 3*2 4*5*6 pattern in j...
In this tutorial, we will see how to print star patterns using * in the c++ program.C++ Heart Pattern made by Control statement, Program will print the Heart pattern according to the user input meaning that heart size will depend on input values, for good heart patter use numbers 4- 8 ...
Code to print the box pattern in C //Code to print the box pattern in C#include<stdio.h>intmain(){intn,i,j,t;//n is representing number of the output box//input nprintf("Enter the value of n:");scanf("%d",&n);t=2*n-1;i=t;//i and j are the number of rows and colu...
Count number of words in a string Reverse number in java Java program to count number of words in sentence Print pyramid pattern: 1 3*2 4*5*6 pattern in java Happy Number program in Java How to find Magic Number in Java Find Perfect Number in Java Find first and last digit of a num...
In this “Diamond Pattern” –We have written Java programs to print/draw Star (X) pattern by using different types of Java loops and you can execute and try these Java program through your IDE. This is most [100+] Frequently Asked Java Program on beginner level to check you Java ...
// Java program to print string in// hexadecimal formatimportjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){Scanner SC=newScanner(System.in);String str;inti=0;System.out.print("Enter string: ");str=SC.next();System.out.print("Hexadecimal string: ");for(i=0;i<str....
C++ Program to convert first letter of each word of a string to uppercase and other to lowercase C++ Program to Find Substring in String (Pattern Matching) C++ Program to Remove Spaces From String C++ Program to Compare Two Strings Using Pointers C++ program to check the entered character is...
Thus, at last, the index value becomes -1 and as in every loop we store the previous index value in the lastIndex and at last print the lastIndex value.Open Compiler //java program to find last index of a particular word in a string using indexOf() method import java.util.*; ...
(that is num-x). And String.init(repeating: "123", count: (2*x) - 1) is used to print “123” in reverse numeric pyramid pattern, here in each iteration init() function repeats numeric string: “123” according to the value of count(that is (2*x) - 1). So the working of ...