sujana-kamasany / javacodes

A repository that will guide in making your first contribution.
29 stars 111 forks source link

Print Floyd's Triangle #60

Open sujana-kamasany opened 2 years ago

sujana-kamasany commented 2 years ago

Add Java Program to print Floyd's Triangle

image

DHARUNKUMAR7 commented 2 years ago

My ans: public class Main {

public static void main(String[] args) throws Exception {
// write your code here
Scanner in = new Scanner(System.in);
int a = in.nextInt();
int b = 1;
for(int i = 0 ; i < a; i++){
    for(int j = 0 ; j < i + 1;j++){
        System.out.print(b++ + " ");
    }
    System.out.println();
}
}

}

DHARUNKUMAR7 commented 2 years ago

Let me know should i make post my answers in comment section or i need to make a pull request if it so help me to make a pull request i am new to it.

sujana-kamasany commented 2 years ago

@DHARUNKUMAR7 Thank you for your solution ! Please go ahead and make a pull request!

Once go through the readme file on making your first contribution and if you are stuck anywhere let me know i will help you out!

Note :

kashish-51 commented 11 months ago

Hey, I want to work on this please assign me