Posts

Showing posts from December, 2024

C#

 C# and .Net Framework Lab SNJPSNMS Degree College, Nidasoshi 1 Program 1: Write c# program to show the machine details like machine name,  operating system, version, physical memory and calculate the time since last  boot up.  using System;  class Program  {  static void Main(string[] args)  {  Console.WriteLine("machine name is:"+Environment.MachineName);  Console.WriteLine("\ncurrent operating systeem is:"+Environment.OSVersion);  Console.WriteLine("\nexecuting version of visual studio .net is"+Environment.Version);  Console.WriteLine("\ncurrent directory is:"+Environment.CurrentDirectory); Console.WriteLine("\nyou have{0} byes of RAM in your system", +  Environment.WorkingSet); Console.WriteLine("\nthe system time since last bootup is:{0} minutes",  (Environment.TickCount)/1000/60);  Console.WriteLine("\nlogical drives in the system are :");  String[] drives=Environment.GetLogicalDrives();  for (int...

Daa

   1) Selection Sort package progame1; import java.util.Scanner ; public class selectionsort { public static void main(String[] args) { // TODO Auto-generated method stub int n; int a[]; a=new int[20]; Scanner sc=new Scanner( System.in ); System.out.println ("enter the size of array"); n= sc.nextInt (); System.out.println ("enter the elements of array"); for(int i=0;i<=n-1;i++) { a[i]= sc.nextInt (); } for(int i=0;i<n;i++) { int min=i; for(int j=i+1;j<=n-1;j++) { if(a[j]<a[min]) { min=j; } } int temp=a[i]; a[i]=a[min]; a[min]=temp; } System.out.println ("The sorted array"); for(int i=0;i<=n-1;i++) { System.out.println (a[i]); } } } 3) KnsapSack Program package program4; import java.util.Scanner ; public class KnapSack { int n;     double c;     double[] p;     double[] w;   ...