Answer:
Console.WriteLine("Format Double: {0:n3}", num); //formatting output with 3 digit decimal point
Explanation:
Following are the program in c#
using System; // namespace
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tasks
{
class Program
2 // program2
{
static void Main(string[] args) // Main function
{
double num = 958254.73789621; // variables
Console.WriteLine("Format Double: {0:n3}", num); //formatting output with 3 digit decimal point
Console.Read();
}
}
}
Output:
Format Double : 958254.737
Here we have declared a variable num of type double which store the value num=958254.73789621. To do format with the double number i used a syntax {0:n3}. This syntax {0:n3}is separated with :(colon) here 0 represent the value before the decimal point that is 958254 and n3 represent the value upto 3 decimal points. Hence this statement give the output with three digit after the decimal point .
Answer:
Differences between Object Oriented Programming and Structured Programming
1. Structured programming focuses on process/logic then data while OOP(Object Oriented programming) focuses on data.
2.OOP supports Inheritance,Encapsulation,Abstraction,Polymorphism while structured programming does not supports these.
3.Structured programming follows top-down approach while OOP follows bottom-up approach.
4.OOP is more secured than structured programming because it supports Abstraction (data hiding).
Answer:
Commands: commands are also known as "programs" and the program is a set of rules that performs a specific task which is executed by a computer.
Unix is an operating system. that supports multi-tasking and multi-user functionality. Unix is most widely used in all forms of computing systems such as desktop, laptop, and servers. It provides a Graphical user interface similar to windows.
The Unix operating system there are various commands. The list of five Unix commands can be given as:
1) cal
2) date
3) banner
4) who
5) whoami
1)cal:
The cal command stands for calender. It displays the date.
Syntax:
$ cal
or
$ cal [[month] year]
Example:
$ cal 10 2019
2)date:
The date command stands for date and time. It displays the system date and time.
Syntax:
$date
or
$ date[+format]
Example:
$ date +%d/%m/%y
3) banner
The banner command stands for display the text in to a large size.
Syntax:
$banner message
Example:
$banner Unix
4) who
The who command stands for display the list of users currently logged in.
Syntax:
$who
or
$who [option] … [file][arg1]
Example:
$who
5) whoami
The whoami command stands for display the user id of the currently logged-in user.
Syntax:
$whoami
Example:
$whoami
Explanation:
1)cal command display the current month and year.
2)date command display system date and time.
3)banner command display text in large size.
4)who command display the user name who currently login.
5)whoami command display user id.