Skip to main content

Posts

Introduction To DBMS

 Database Management System  A database is an organized collection of data. A Database Management System is a collection of interrelated data and a set of programs to access those data. The main purpose of DBMS is to provide a way to store and retrieve database information that is both convenient and efficient. Management of data involves both defining structures for the storage of information and providing mechanisms for the manipulation of information. In addition, the database system must ensure safety crashes or attempts at unauthorized access. Applications of Database System Banking: For customer information, accounts, and loans, and banking transactions. Airlines: For reservations and schedule information. Airlines were among the first to use databases in a geographically distributed manner. Terminals situated around the world accessed the central database system through phone lines and other data networks. Credit card transactions: For purchase on credit cards and gener...

WAP to find odd even, prime_composite, and factorial of a number using function

  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace function { Class Program { static void main(string[] args) { prime_comp(); factorial(); odd_even(); } static public void odd_even() { int n; Console.WriteLine("Input any number."); n= Convert.ToInt32(Console.ReadLine()); if (n%2==0) { Console.WriteLine("The number is even."); } else { Console.WriteLine("The number is odd."); } Console.ReadLine(); } static public void factorial() { int n, i, fact = 1; Consol.WriteLine("Input any number."): n  = Convert.ToInt32(Console.ReadLine()): for(n==0) { Console.WriteLine("The factorial of 0 is 1"); } else{ for(i=1; i<=n; i++) { fact = fact * i; } Console.WriteLine("The factorial of given number is: {0}",fact); } } static public void prime_comp() { int num, flag = 0; Console.WriteLine("Input any number."); num = Convert.ToInt32(Console.ReadLine()); fo...

WAP to display series as given:

a). 1, 5, 10 ,15, 20 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace series1 { Class Program { static void main(string[] args) { int n, i=1, mul=1; Console.WriteLine("How many number."); n = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("{0}",i); for(i = 1; i<=n ;i++) { mul = i* 5; Console.WriteLine("{0}", mul); } Console.ReadLine(); } } } OUTPUT: How many numbers. 5 1 5 10 15 20 25 b). 0, 2, 4, 6 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace series2 { Class Program { static void main(string[] args) { int n, i; Console.WriteLine("Enter how many terms."); n= Convert.ToInt32(Console.ReadLine()); for(i=0; i<n; i++) { if (i%2 == 0) { Console.WriteLine("{0}", i); } Console.ReadLine(); } } } OUTPUT:  Enter how many terms. 8 0 2 4 6 c). 0, 1, 1, 2, 3, 5,7...... using System...

WAP to find multiplication table of given number

  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Multiplication_Table { Class Program { static void main(string[] args) { int i, n, mul; Console.WriteLine("Input any number."); n= Convert.ToInt32(Console.ReadLine()): Console.WriteLine("The multiplication table of {0} is : ", n) for(i=1; i<=0; i++) { mul = n* i Console.WriteLine("{0}", mul); } Console.ReadLine(); } } } OUTPUT: Input any number. 5 The multiplication table of 5 is : 5 10 15 20 25 30 35 40 45 50

WAP to find factorial of a given number

  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace factorial { Class Program { static void main(string[] args) { int fact = 1, i, n; Console.WriteLine("Input any number."); n = Convert.Toint32(Console.ReadLine()); if( n == 0) { Console.WriteLine("The factorial of 0 is 1."); Console.ReadLine(); } else  { for(i=1; i<=n; i++) { fact = fact*i; } Console.WriteLine("The factorial of a given number is: {0}", fact); Console.ReadLine(); } } } } OUTPUT: Input any number.  5 The factorial of a given number is: 120

WAP to swap two numbers

  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace swap { Class Program { static void main(string[] args) { int A, B, C; Console.WriteLine("Input first number."); A= Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Input second number."); B= Convert.ToInt32(Console.ReadLine()); Console.WriteLine("The number before swapping are : A={0} B= {1}", A,B) C= A; A= B; B = C; Console.WriteLine("The number after swapping are: A={0}  B = {1}", A,B); Console.ReadLine(); } } } OUTPUT: Input first number. 5 Input second number. 6 The number before swapping are : A = 5  B = 6 The number after swapping are : A= 6      B= 5

WAP to find the sum of first five odd numbers

  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace sum_odd { Class Program { static void main(string[] args) { int i, sum = 0; Console.WriteLine("The first five odd numbers are:"); for(i=1; i<10; i++) { if (i%2 != 0) { Console.WriteLine("{0}",i); sum = sum +i; } } Console.WriteLine("The sum of the first five odd number is :{0}",sum); Console.ReadLine(); } } } OUPUT: The first five odd numbers are: 1 3 5 7 9 The sum of the  first five odd number is : 25