Skip to main content

Posts

Get Even Numbers Using Java Stream API

Java Stream API — Even Numbers (Full Screen) Java Stream API — Get Even Numbers Example 1 — Filter even numbers from a list Creates a list, uses Stream to filter evens, and prints them. Copy import java.util.*; import java.util.stream.*; public class EvenNumbersStream { public static void main(String[] args) { // Create a list of numbers List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); // Use Stream API to filter even numbers List<Integer> evenNumbers = numbers.stream() .filter(n -> n % 2 == 0) .collect(Collectors.toList()); // Print the even numbers System.out.println( "Even numbers: " + evenNumbers); } } Example 2 — Use IntStream.rangeClosed ...

WhatsApp Application Crashing

In this Post , we will discuss about the new spam message , which has recently started circulating via whatsapp and it is making everyone’s whatsapp application crashed... A new spam message has recently started circulating via whatsapp that is making everyone’s whatsapp application crashed when they’re clicking on the message that is something like – “if you touch the black point then your whatsapp will hang..don’t touch here”.(See pic1) pic1 For understanding the reason, you’ll need to have a basic knowledge about ASCII values. Typically ASCII decimal number is created from binary, which is the language that all computers understand. Each alphabet has its own ASCII value (i.e: "A" has a ASCII value of 065). So if you send a text message on whatsapp, the system first breaks down each and every alphabet into ASCII characters. But there’s a limit in the numbers of text (ASCII values) that you can send via a single message in whatsapp messenger. Whatsapp encount...

Factorial of an integer number using RECURSION in C-Language

In this C program we will calculate the Factorial of a number(integer) using RECURSION method and print the result, in the screen. The number(integer) will be taken from the user. input: The number(integer) (i.e. 5,7 etc.) output: The Factorial of the number will be printed on the screen. CODE----> #include<stdio.h> #include<conio.h> int fact(int x ) ;    //Function declaration main() {      int x,ans;      printf( " Enter the number : " ) ;      scanf( " %d ",&x ) ;      ans= fact( x ) ;     //Function Call      printf( " \n The factorial of %d is : %d ",x,ans ) ;      getch(); }    //Main function ends here int fact(int x )     //Function Structure {      int f;      if( x==0 )   ...

nPr & nCr Calculator using C-Language

In this C program we will calculate the nPr or nCr and print the result, in the screen. The choice will be taken from the user. User can calculate nCr or nPr by choice. If you are new in nPr or nCr and want to know about nPr or nCr ,please, click below : https://gradestack.com/Complete-CAT-Prep/Permutation-and/Meaning-and-Derivation-of/19142-3882-35788-study-wtw input: User's Choice. (i.e. 1.for nPr and 2.for nCr) & then, objects(n) and samples(r). output: The Calculated result will be printed on the screen. CODE----> #include<stdio.h> #include<conio.h> #include<math.h> #include<stdlib.h> int npr () ; int ncr () ; int fact (int num3 ) ; main() {      int choice;      printf( " *********Menu*********\n " ) ;      printf( " 1.nPr\n2.nCr\n\n " ) ;      printf( " Please, Enter Your Choice : " ) ;      scanf(...

C- Program of Multiplication of two numbers using Addition method

In this C program we will calculate the multiplication of two numbers(integers) using addition method and print the result, in the screen. The two numbers(integers) will be taken from the user. input: The two numbers(integers) (i.e. 5,10,7 etc.) output: The multiplication of the two numbers will be printed on the screen. CODE----> #include<stdio.h> #include<conio.h> main() {      int num1,num2,mul=0,i=1;      printf (" Enter the first number : ");      scanf (" %d ",&num1);      printf (" \nEnter the second number : ");      scanf (" %d ",&num2);      while( i )      {          mul=mul+num2;          i++;      }      printf (" \n\n The result is : %d * %d = %d ",num1,num2,mul);...

Calculate Gross Salary

input: Basic Salary,DA and HRA (i.e. 6000,250,500 etc.) output: The Gross Salary will be printed on the screen. CODE----> #include<stdio.h> #include<conio.h> main() {        float basic, hra, da, pf, gross;        printf (" Enter Basic Salary : ");        scanf (" %f ",&basic);        printf (" \nEnter HRA : ");        scanf (" %f ",&hra);        printf (" \nEnter D.A. : ");        scanf (" %f ",&da);        /*pf = 10%*/        pf= (basic*10)/100;        printf ("\nPF = %f ",pf);        gross=basic+da+hra+pf;        printf ("\n\nGross Salary : %f ",gr...

Sum of two Integer numbers using function

In this C program we will calculate the summation of two numbers(int) using "Function" and print the result, in the screen. The two numbers will be taken from the user. input: Two numbers(int). (i.e. 15,23 etc.) output: Summation of the given numbers(int) will be printed on the screen. CODE----> #include<stdio.h> #include<conio.h> #include<stdlib.h> int sum();     /* function declaration */ main()     /* main function */ {       int choice;       printf (" **********WELCOME**********\n\n ");       printf (" Please, select your choice.\n ");       printf (" 1.Addition(press 1, for addition)\n2.Exit(press 2,for quit)\n\n ");       printf (" Please, Enter your choice : ");       scanf (" %d ",&choice);       if( cho...

OR Gate

OR Gate Introduction :- The OR Gate performs logical addition, commonly known as OR function. The OR Gate has two or more inputs and only one output. The operation of OR Gate is such that a HIGH (1) on the output is produced when any of the input is HIGH (1). The output is LOW (0) only when all the inputs are LOW (0). Logic Expression :- If A and B are the input variables of an OR Gate and Y is it's output, then, Y = A + B Truth-Table :- Truth-Table of OR Gate Logic Symbol of 2-input OR Gate :- Logical symbol of 2-input OR Gate OR Gate's IC-base diagram :- OR-Gate's IC-base diagram Apparatus :- Bread-board, LED-light, Battery(Power-Supply), IC-7432, Multimeter and Resistance. Procedure :-      1. Verify whether all the wires and components are in good condition.      2. Set-...