Thursday, September 26, 2019
Thursday, September 12, 2019
Calculate factorial of a number using Recursion
Calculate factorial of a number using Recursion
import
java.util.Scanner;
public class
FactorialOfNumber {
static int
factorial(int n) {
if (n == 0)
return 1;
else
return (n * factorial(n - 1));
}
public static void
main(String args[]) {
int i, fact = 1;
//Input the number
System.out.println("Enter
a Number");
Scanner sc= new
Scanner(System.in);
int number = sc.nextInt();
fact = factorial(number);
System.out.println("Factorial
of " + number + " is: " + fact);
}
}
Enter a Number
5
Factorial of 5 is: 120
Wednesday, September 11, 2019
Print * Patterns in Java
Print * Patterns in Java
* * * * *
* * * *
* * *
* *
*
Java Code:
public class
PatternEx3 {
public static void
main(String[] args) {
int row = 5;
for (int i = 0; i <=
5; i++) {
// Printing i spaces at the
beginning of each row
for (int j = 1; j <= i; j++) {
System.out.print("
");
}
// Printing j *'s at the end of
each row
for (int j = row; j > 0;
j--) {
System.out.print("*
");
}
System.out.println();
// Decrementing the row
row--;
}
}
}
Write a program to calculate grade of Students
Write a program to calculate the grade of Students
Conditions:
A+ >= 85%,
A >= 70% to < 85%
B >= 60% to < 70 %
C >= 50% to < 60%
D >= 40% to < 50%
F < 40%
Instruction:
1. Input the marks from Command Line between 0 and 100.
2. The output will be grade of the student.
i.e :
Case1:
Please enter the Marks:
50
Result: Passed, Grade - C
Case2:
Please enter the Marks:
39
Result: Failed, Grade - F
Tuesday, September 10, 2019
Print triangle star pattern in Java
Print triangle start pattern in Java
*
* *
* * *
* * * *
* * * * *
Java Code:
public class PatternEx2 {
public static void main(String[] args) {
int i, j, k;
//outer loop for row
for (i = 1; i <= 5; i++) {
//inner loop: print space
for (j = 4; j >= i; j--) {
System.out.print(" ");
}
//inner loop: print * with space
for (k = 1; k <= i; k++) {
System.out.print("* ");
}
//Print next line
System.out.println("");
}
}
}
Sunday, September 1, 2019
Top seven sites of free coupons for online courses
Top seven sites of free coupons for online courses
3) https://couponscorpion.com/
5) https://bestcouponhunter.com/
6) https://www.promocoupons24.com/
Friday, August 30, 2019
CDAC certification courses list
IT Applications
IT Applications
Mobile Applications
Software Development & Testing
High Performance Computing
VLSI Design
Infrastructure and Network Security
Subscribe to:
Posts (Atom)
Create a Digital Clock using HTML and JavaScript
Create a Digital Clock using HTML and JavaScript <! DOCTYPE html> < html > < head > ...
Followers
Search This Blog
Popular Posts
-
MG-CEIT Course Feedback Form Step1: Like below three pages for the updated course information ...
-
Software Development Tools Presentation From the moment you begin developing software, whether as a freelancer for a startup or wo...
-
Question 1 Which framework is most commonly used for unit testing in Java? JUnit TestNG Mockito Selenium Answer: JUnit Question 2 I...
-
import redis from 'redis'; // Create a Redis client with retry strategy const client = redis.createClient({ host: 'localhos...
-
const redis = require('redis'); const { promisify } = require('util'); // Create a Redis client with a connection timeout...
-
Use Request Dispatcher Servlet in creating simple Login Form We are going to create a Login Form Here. At the end of this section, y...
-
max-request-journal-entries and no-request-journal in wiremock configuration In WireMock, the request journal is a built-in feature that ke...
-
कोरोना को जाने प्रश्न (1) :- क्या कोरोना वायरस को ख़त्म किया जा सकता है उत्तर:- नहीं! कोरोना वायर...
-
Create a Digital Clock using HTML and JavaScript <! DOCTYPE html> < html > < head > ...
-
Clear cache || FlushDB || Clear Redis Cache ||Node js ||aws const express = require('express'); const redis = require('redis...