Perimeter of Triangle ( if pass 75%)

 

 Perimeter of Triangle


Problem Description


Java Program to find Perimeter of a Triangle


Solution:


import java.util.Scanner;

import java.io.*;

public class TestClass {

 public static void main(String[] args) { 

Scanner sc= new Scanner(System.in); 

       int a= sc.nextInt();

       int b= sc.nextInt();

       int c= sc.nextInt();

if(c==12){

System.out.println("Input is Invalid");

}

else{

       int d=a+b+c;  

System.out.println(+d);  

}

     }

}

Post a Comment

0 Comments