ISC Assignment

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Q:1 Write a C program to add two numbers (which are in range of integer datatype)

and give sum as output even though their sum is out of range of integer datatype.
Output
Q:2 Write a C program to calculate average grade, taking grade as input from the
user, on entering any negative grade a message should be printed that negative is
not allowed and when -1 is entered the program gets terminated.

Output
Q:3 Write a C program to calculate Volume and Surface Area of a Box taking
length, breadth and height as input from the user.

Output
Q:4 Write a C program to calculate original number of cookies, when m childrens,
each ate half the number of cookies, and finally remaining cookies are n.

Output
Windows File Extensions

• File Extension File Type


• .AIFF or .AIF Audio Interchange File Format
• .AU Basic Audio
• .AVI Multimedia Audio/Video
• .BAT PC batch file
• .BMP Windows BitMap
• .CLASS or .JAVA Java files
• .CSV Comma separated, variable length file (Open in Excel)
• .CVS Canvas
• .DBF dbase II, III, IV data
• .DIF Data Interchange format
• .DOC or .DOCX Microsoft Word for Windows/Word97
• .EPS Encapsulated PostScript
• .EXE PC Application
• .FM3 Filemaker Pro databases (the numbers
following represent the version #)
• .GIF Graphics Interchange Format
• .HQX Macintosh BinHex
• .HTM or .HTML Web page source text
• .JPG or JPEG JPEG graphic
• .MAC MacPaint
• .MAP Web page imagemap
• .MDB MS Access database
• .MID or .MIDI MIDI sound
• .MOV or .QT QuickTime Audio/Video
• .MTB or .MTW MiniTab
• .PDF Acrobat -Portable document format
• .T65 PageMaker(thenumbersfollowingrepresenttheversion#)
P=publication, T=template
• .PNG Portable Network Graphics
• .PPT or .PPTX PowerPoint
• .PSD Adobe PhotoShop
• .PSP PaintShop Pro
• .QXD QuarkXPress
• .RA RealAudio
• .RTF Rich Text Format
• .SIT Stuffit Compressed Archive
• .TAR UNIX TAR Compressed Archive
• .TIF TIFF graphic
• .TXT ASCII text (Mac text does not contain line feeds--use
DOS Washer Utility to fix)
• .WAV Windows sound
• .WK3 Lotus 1-2-3 (the numbers following represent the version #)
• .WKS MS Works
• WPD or .WP5 WordPerfect (the numbers following represent the version #)
• .XLS or .XLSX Excel spreadsheet
• .ZIP PC Zip Compressed Archive
Rules for naming files in linux

Following are general rules for both Linux, and Unix (including *BSD) like
systems:
1. All file names are case sensitive. So filename vivek.txt Vivek.txt VIVEK.txt
all are three different files.
2. You can use upper and lowercase letters, numbers, “.” (dot), and “_”
(underscore) symbols.
3. You can use other special characters such as blank space, but they are
hard to use and it is better to avoid them.
4. In short, filenames may contain any character except / (root directory),
which is reserved as the separator between files and directories in a
pathname. You cannot use the null character.
5. No need to use . (dot) in a filename. Some time dot improves readability
of filenames. And you can use dot based filename extension to identify
file. For example:
.sh = Shell file
.tar.gz = Compressed archive
6. Most modern Linux and UNIX limit filename to 255 characters (255
bytes). However, some older version of UNIX system limits filenames to
14 characters only.
7. A filename must be unique inside its directory. For example, inside
/home/vivek directory you cannot create a demo.txt file and demo.txt
directory name. However, other directory may have files with the same
names. For example, you can create demo.txt directory in /tmp.

# Linux / UNIX: Reserved Characters And Words


Avoid using the following characters from appearing in file names:

/
>
<
|
:
&
• Please note that Linux and UNIX allows white spaces, <, >, |, \, :, (, ), &, ;,
as well as wildcards such as ? and *, to be quoted or escaped using \
symbol.
chmod command in Liniux

In Unix operating systems, the chmod command is used to change the access
mode of a file. The name is an abbreviation of change mode. Which states that
every file and directory has a set of permissions that control the permissions
like who can read, write or execute the file. In this the permissions have three
categories: read, write, and execute simultaneously represented by `r`, `w`
and `x`. These letters combine together to form a specific permission for a
group of users.

The `chmod` command is used to modify this permission so that it can grant
or restrict access to directories and files. Let’s have a look at the syntax and
options for the `chmod` command in Linux Operating System.

Syntax:

chmod [options] [mode] [File_name]


“chmod” in Linux [options]
Options Description
`-R` Apply the permission change recursively to all the files and directories
within the specified directory.
`-v` It will display a message for each file that is processed. while indicating
the permission change that was made.
`-c` It works same as `-v` but in this case it only displays messages for files
whose permission is changed.
`-f` It helps in avoiding display of error messages.
`-h` Change the permissions of symbolic links instead of the files they point
to.
Note: Options in `chmod` are basically used for making changes in bulk and
modifying permissions across multiple files or directories at once.
“chmod” in Linux [mode]
The “mode” helps in setting new permissions that have to be applied to files
or directories.

This mode can be specified in several ways, we will discuss two modes:
Symbolic and Octal mode.

1) Symbolic mode
If we talk about symbolic mode, we can say that it is the most common method
used for specifying fir permissions. In this we have to make a combination of
letters and operators to set or tell what to do with permissions.

The following operators can be used with the symbolic mode:

Operators Definition
`+` Add permissions
`-` Remove permissions
`=` Set the permissions to the specified values
The following letters that can be used in symbolic mode:

Letters Definition
`r` Read permission
`w` Write permission
`x` Execute permission
The following Reference that are used:

Reference Class
u Owner
g Group
o Others
a All (owner,groups,others)
Examples of Using the Symbolic mode:
Read, write and execute permissions to the file owner:
chmod u+rwx [file_name]
Remove write permission for the group and others:
chmod go-w [file_name]
Read and write for Owner, and Read-only for the group and other:
chmod u+rw,go+r [file_name]
2) Octal mode
It is also a method for specifying permissions. In this method we specify
permission using three-digit number. Where..

First digit specify the permission for Owner.


Second digit specify the permission for Group.
Third digit specify the permission for Others. The digits
NOTE: The digits are calculated by adding the values of the individual
permissions.

Value Permission
4 Read Permission
2 Write Permission
1 Execute Permission
Examples of Using the Octal mode:
Suppose if we to give read and write permission to the file Owner. Read, write
and executable permission to the Group. Read-only permission to the Other.
They our command would be.
chmod 674 [file_name]

Here.
6 represent permission of file Owner which are (rw).
7 represent permission of Group which are (rwx).
4 represent permission of Other which is (r).

You might also like