From bde631453127b9da834524662da08ed0a3f15c2f Mon Sep 17 00:00:00 2001 From: Ritz2626 Date: Sat, 16 Oct 2021 12:54:15 +0530 Subject: [PATCH] A java program to wish happy birthday Added a program which wishes the user happy birthday with a pattern based on his age. --- examples/hbd.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 examples/hbd.java diff --git a/examples/hbd.java b/examples/hbd.java new file mode 100644 index 0000000..975f9f6 --- /dev/null +++ b/examples/hbd.java @@ -0,0 +1,24 @@ +import java.util.*; +class hbd +{ + public static void main(String[]args) + { + Scanner sc=new Scanner(System.in); + System.out.println("Enter your age"); + int n=sc.nextInt(); + String s="HAPPY BIRTHDAY"; + for(int x=0;x<14;x++) + { + char ch=s.charAt(x); + if(ch==' ') + { + System.out.println(); + continue;} + for(int y=0;y