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 ...
In this C program we will print "Hello World", 10 times on the screen. We will use "body-less-loop" for this C-Program.
"Body-less-loop" : it means that the inner part(code block to be executed) of the loop will be empty and the loop will have a semi-colon(;) in it's end.
i.e:
for ( ..... ; ..... ; ..... ) ;
input:
Null.output:
"Hello World" will be printed on the screen, 10 times.
CODE---->
#include<stdio.h>
int main()
{
int i;
for(i=1;i<=10;printf(" Hello World ! \n",i++));
return 0;
}
RESULT:
hey! you did such a nice work.Check out program for prime number
ReplyDeleteThank You So Much Pavan.
ReplyDeleteWe will be happy to see your program.
Word count is an usefull tool to count Word, Line, Page and Character in multiple files and also you can calculate amount and generate reports. word count tool
ReplyDeleteSuch a great blog! I am looking for these kinds of blogs for last many days. Keep it up. Thanks for sharing it with us
ReplyDeleteBest online Coaching app
Best online teaching apps
Yes, Priya u are absolutely right..!
Delete
ReplyDeleteVery Informative and creative contents. This concept is a good way to enhance the knowledge. thanks for sharing.
Continue to share your knowledge through articles like these, and keep posting more blogs.
And more Information Data Labeling Service for Machine Learning
Ntreppearwa Aaron Stevens https://marketplace.visualstudio.com/items?itemName=9musjicerzu.Cosplay-Convention-Crisis-gratuita-2022
ReplyDeletespitinswitoc
0ingraphsur-o Sean Kalina https://www.yodfatstyle.com/profile/visionimeldaimelda/profile
ReplyDeletekefucoself
pidupres-ru_Columbia Nancy Evans Here
ReplyDeletetenminali
MconsperPalbu Tom Grable click
ReplyDeletevordentserga
adittog_pi Gina Glover Help & Manual Professional 8.3.1.5793
ReplyDeletePhoneTrans Pro 5.3.0.20220816
CCleaner pro
Soft Organizer Pro 9.26
myiberwari
Apploid Studios is always inspired by innovative ideas in tech! As one of the leading app development companies we understand the importance of blending creativity with functionality to deliver top-notch mobile solutions. It’s exciting to see discussions around app design and development here. Keep sharing such insightful content!
ReplyDelete