Skip to main content

Posts

Showing posts from November, 2019

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 ...

CU Question Paper 2017 CMSA 3rd Year

   Download the 2017 Hon. Question Paper. COMPUTER SCIENCE - HONOURS [Part - III : 3rd Year] FIFTH PAPER - 2017 Full Marks - 100 Answer Question No. 1 and any five questions from the rest taking at least one from each group 1. Answer any ten questions : (marks 2 X 10) (a) Distinguish between software interrupt and non-muskable interrupt. (b) Why is data bus bidirectional ? (c) Mention the differences between JZ and JNZ. (d) What is DMA ? (e) What is Bus Arbitration ? (f) What is the funtion of 8279 ? (g) What is the differences between opcode and operand ? (h) What is ROM BIOS ? (i) What is Client-Server model ? (j) What is router ? (k) What is MAC address ? (l) What is Shannon's capacity ? (m) What is the difference between bit rate and baud rate ? (n) What is the difference between guided and unguided media ? (o) What is E-mail ? Group - A 2.(a) Discuss the functions of the following signals of 8085 microprocessor : IO/ M , INTR, HOLD, ...

Radix Sort in C Language

In this C program we will perform Radix Sort . The Number of elements and the highest length of the number will be taken from the user. input: The number of the elements The highest length of the number The elements or values or data output: The sorted elements will displayed on the screen after Radix sorting. CODE----> #include<stdio.h> #include<stdlib.h> #include<math.h> int main () { int a [ 20 ][ 10 ], b [ 20 ], top [ 10 ], len , i , j , k , n , p , pos ; printf ( "Enter the number of elements: " ); scanf ( "%d" ,& n ); printf ( "\nEnter the highest length of the number: " ); scanf ( "%d" ,& len ); printf ( "\nEnter the elements: " ); for ( i = 0 ; i <= n - 1 ; i ++) scanf ( "%d" ,& b [ i ]); //Radix Sort Technique// for ( i = 0 ; i < len ; i ++) { for ( j = 0 ; j < 10 ; j ++) top [ j ]=- 1 ; for ( j = 0 ; j < n ; j ++) { po...