0% found this document useful (0 votes)
3 views65 pages

PK Project

The document outlines a project work submission by Prashamsa Kunwar for Grade XI Computer Science at the Global School of Science, covering various software applications including MS-Word, MS-Excel, MS-PowerPoint, HTML, CSS, and C Programming. It includes features, usage instructions, and examples for each software, along with a certificate of completion. The project serves as a partial fulfillment of the curriculum requirements under the National Education Board, Nepal.

Uploaded by

Samriddhi Gautam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views65 pages

PK Project

The document outlines a project work submission by Prashamsa Kunwar for Grade XI Computer Science at the Global School of Science, covering various software applications including MS-Word, MS-Excel, MS-PowerPoint, HTML, CSS, and C Programming. It includes features, usage instructions, and examples for each software, along with a certificate of completion. The project serves as a partial fulfillment of the curriculum requirements under the National Education Board, Nepal.

Uploaded by

Samriddhi Gautam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

GLOBAL SCHOOL OF SCIENCE

PROJECT WORK
(COMPUTER SCIENCE)

SUBMITTED BY: SUBMITTED TO:


NAME: Prashamsa Bibek Baniya
Kunwar
CLASS: XI‘K1’ Department of
ROLL NO.: ‘29’ Computer Science
A Project On
Ms-Word/ Ms-Excel/ Ms-PowerPoint/ HTML/ CSS and
C Programming

Submitted as a partial fulfillment of requirement of the curriculum of


GRADE-XI (Computer Science) under National Education Board, Nepal

Submitted By:
Prashamsa Kunwar

Under Supervision Of :
Bibek Baniya

Date:
1st May, 2025
Global School of Science
Mid Baneshwor, Kathmandu Nepal

GLOBAL SCHOOL OF SCIENCE


Mid Baneshwor, Kathmandu

Certificate
This is to certify that Mrs Prashamsa Kunwar has successfully
completed his/her project work as per the requirement of the
curriculum of GRADE-XI (Computer Science) under National
Education Board, Nepal. He/ She has completed his/her project
work within the prescribed period.
NEB Symbol no/Registration no.:
( Internal Examiner) (External Examiner)

Date: 1st May, 2025


Contents
MS-Word (Word Processor)........................................................................................................................5
Features of MS-Word..............................................................................................................................5
The steps to open Microsoft Word..........................................................................................................6
To Prepare CV..........................................................................................................................................7
Curriculum Vitae(CV)...............................................................................................................................8
TO MAKE CHARACTER.............................................................................................................................9
CERTIFICATE............................................................................................................................................9
MS-Excel (Spreadsheet).............................................................................................................................11
Common terminologies used in spreadsheet........................................................................................11
Features of MS-Excel.............................................................................................................................12
Cell reference in Excel...............................................................................................................................12
steps to open Microsoft Excel:..............................................................................................................13
TO PREPARE MARKSHEET USING MS EXCEL..........................................................................................13
MS-Powerpoint (Presentation)..................................................................................................................15
Features of MS-Powerpoint...................................................................................................................15
Introduction to HTML................................................................................................................................15
Use of HTML:.........................................................................................................................................15
Advantages of HTML:............................................................................................................................16
Disadvantage of HTML:..........................................................................................................................16
Tags.......................................................................................................................................................16
HTML Formatting Elements...................................................................................................................17
HTML <font> Tag...................................................................................................................................18
HTML Images.........................................................................................................................................19
HTML Audio:..........................................................................................................................................20
HTML Links............................................................................................................................................21
HTML Tables..........................................................................................................................................22
HTML Lists.............................................................................................................................................24
HTML <form> Tag..................................................................................................................................25
Cascading Style Sheets (CSS).....................................................................................................................27
Using CSS...............................................................................................................................................27
Inline CSS...............................................................................................................................................27
Internal CSS...........................................................................................................................................28
External CSS...........................................................................................................................................29
C Introduction............................................................................................................................................30
What is C?..............................................................................................................................................30
Why Learn C?.........................................................................................................................................30
Difference between C and C++..............................................................................................................30
C Output................................................................................................................................................33
The else if Statement.............................................................................................................................39
Nested if:...............................................................................................................................................42
C Switch.................................................................................................................................................43
For Loop.................................................................................................................................................46
While Loop............................................................................................................................................49
The Do/While Loop................................................................................................................................52
Break statement....................................................................................................................................55
Continue statement...............................................................................................................................56
Goto statements....................................................................................................................................57
Arrays....................................................................................................................................................58
Strings....................................................................................................................................................62
CONCLUSION:............................................................................................................................................65
BIBLIOGRAPHY:..........................................................................................................................................65
WEB REFERENCES:.................................................................................................................................65
MS-Word (Word Processor)
Introduction: Ms-Word is a text editing or word processing software develop by Microsoft
Corporation, USA under MS-Office package. Word processing refers to use of computer to
create, edit and print documents. A word processor enables us to create a document, store it
electronically in a disk, display it on a screen, modify it by entering commands and characters
from keyboard and print it on a printer. MS-Word is a windows based application it has many
powerful and advance feature to manipulate the document, With the help of this program we can
create any types of documents like letters, reports, thesis, manuals, brochures, advertisement an
many other document. Beside creating, editing and modifying the documents MS-Word provides
some special facilities such as checking spelling and grammatical error, to search for synonyms
and antonyms, to work with columns, tables, special symbols, pictures, graphs, charts and many
more. The document created with MS-Word have “.doc” extension. The newer version of MS-
Word has newer extension “.docx”".

Features of MS-Word
a. Fast operation: Since, MS-Word is a digital text editing software there is no any mechanical
movement associated. Hence, it is faster in operation.

b. Editing text feature (Character formatting): Any type of operation like insert, delete,
modify the documents and undo/redo, find/replace can be perform very easily. Similarly, we can
customize our text document in any form or style like bold, italic, underline, different font size,
different font color, different font style can be perform etc.

c. Permanent storage: Using MS-Word file and documents can be electronically stored in a
disk or any other storage media. So, we can retrieve it whenever require.

d. Graphics: Ms-Word allows us to insert several objects like pictures and graph anywhere in
the document whenever required.
e. OLE (Object Linking and Embedding): OLE is a technology which are used to share
information between program through object. Objects are saved entities of different type like
charts, equations, picture, audio and video files etc.

f. Mail merge: Mail merge a useful tool that will allow us to easily produce multiple letters,
labels, envelops and more using information stored in a list, database or spreadsheet.

g. Searching: Ms-Word allows us to search any word or text and replace or delete with other
necessary ones throughout the entire document.

h. Printing: Ms-Word allows user to print the documents created by the user anytime, anywhere.

i. Formatting a document: Word has various tools which help format a document. Formatting
refers to the process of enhancing the appearance of the document to make it more readable and
attractive. We can search and replace, display ruler, change a paragraph alignment, change line
spacing, creating bullets and numbering to show your information in list. To further enhances the
appearance of the text and documents. We can add border and shading even more we can add
watermark to denote some confidential information in a document.

j. Spelling and Grammar checker: Ms-Word provides you with several features that will help
you to produce professional and error free document. To make your document appear
professional, you want to make sure it is free from spelling and grammar error. Word also has
feature of checking grammatical and spelling error and notifying users by different colored wavy
lines either may be red or green.

k. Use of thesaurus: Ms-word thesaurus makes it possible to look up synonyms and antonyms to
words with few clicks of mouse. We can automatically replace a word by a respective antonyms
or synonyms.

The steps to open Microsoft Word:


1. On Windows:
 Click the Start button (Windows icon) in the bottom-left corner of your screen.
 In the search bar, type "Word" or "Microsoft Word."
 Click on Microsoft Word when it appears in the search results.
 Alternatively, you can click on the Microsoft Word icon on your desktop or taskbar if it
is pinned there.
2. On Mac:
 Click on the Finder icon (smiley face) in the Dock.
 Go to the Applications folder.
 Find and double-click on Microsoft Word to open it.
 You can also use Spotlight Search by pressing Command + Space, then typing
 "Word" and selecting Microsoft Word from the search results.
3. Using a Shortcut (Windows):
 If Microsoft Word is pinned to your taskbar, simply click the Word icon to open it.
4. Using a Shortcut (Mac):
 If Microsoft Word is in your Dock, click the Word icon to open it.
 Once open, you can start creating or editing your document.

To Prepare CV
Here are the short steps to prepare a CV in MS Word:
1. Open MS Word and select a Blank Document.
2. Set page layout to A4, portrait orientation, and normal margins.
3. Type your name and contact details at the top.
4. Add CV sections with bold headings:
 Career Objective
 Academic Qualification (use table or list)
 Skills
 Experience (if any)
 Projects (if any)
 Achievements/Certifications
 Hobbies/Interests
 Personal Details (DOB, gender, language, etc.)
 Declaration
5. At the bottom, write Date, Place, and Signature.
6. Format neatly using the same font and proper spacing.
7. Save the file (File > Save As) or export it as PDF.
Curriculum Vitae(CV)
TO MAKE CHARACTER
CERTIFICATE
1. Open MS Word

 Start a new document.

2. Set Page Margins and Formatting (Optional)

 Go to Layout → Margins → Normal (to set standard margins).


 Choose your preferred font (commonly used: Times New Roman or Arial, size 12).

3. Add Header

 You can add the Organization Name or School/College Name at the top, centered.

• Example:

 XYZ School
 Character Certificate

4. Add the Date

• Below the header, write the date the certificate is being issued.
• Example:
 Date: 5th April 2025

5. Write the Certificate Body

• Begin with a formal salutation or title like:


• To Whom It May Concern,
• Follow with the body content
Output
MS-Excel (Spreadsheet)
MS-Excel is a spreadsheet software in the Microsoft office suite that allows user to store,
organize and analyze numerical and text data. It is a part of MS-Office package. A spreadsheet
program allows to present information in a clear way. It can be use to perform mathematical
calculation using several mathematical formula and equations. Excel also allows us to convert
spreadsheet data into various charts like bar-graph, columns and other. It can be use to calculate
the data according to the need of the user such as salary sheet, income and expenses statement,
balance sheet, budget preparation, grade and percentage calculation etc. Some application areas
of excel are:

1. Basic mathematical calculation.


2. Financial modeling and analysis.
3. Statistical analysis
4. Scientific and engineering calculation.
5. Graphic presentation and more.
The extension of MS-Excel file is “.xlsx” and “.xls”".

Common terminologies used in spreadsheet.


1. Worksheet (Spreadsheet): Worksheet is the collection of rows and columns which are
used to list, organize and calculate data.

2. Workbook: The files that are used in spreadsheet are collectively known as workbook.
Workbook are made up of several numbers of worksheet. By default, one workbook have
three worksheet.

3. Cell: The intersection of rows and columns are called cell. In order to refer a cell, enter a
column letter followed by row number. For eg, C2 the cell where intersection point is
called active cell.

Features of MS-Excel
 It facilitates us to work in a multiple worksheet at a time.
 It allows us to create different types of charts and graphs.
 It allows us to organize and manage large volume of data.
 It allows us to perform any type of calculation automatically by using custom formula
and equation.
 It allows us to easily sort the data in ascending and descending order.
 It supports high level features like object linking and embedding.
 It allows us to format a data to make it more attractive by using tools like font size, font
color etc.
 Simple computing operation such as cut, copy, paste, find, replace can be easily done.
 It includes internet features such as web tool bar.
 It allows us to store data electronically in any storage medium.

Cell reference in Excel


A cell location in a spreadsheet is referred to as its cell reference. To find a cell reference, simply
look at column heading to find which column the cell is in and across to find which row it is in.
The cell reference is a combination of column letter and row number such as A1, B3, Z9 …
When writing cell reference the column letter should always comes first. Specially cell reference
is very important while writing formula or addressing the cell to evaluate the cell. For eg, if we
want to add values 3 and 2 which are in A1 and A2 respectively, instead of writing A3=3+2 we
write A3=A1+A2

There are two types of cell reference.

Relative cell reference: In excel, a relative cell reference identifies the location of the cell or
group of cell. Cell reference are used in formula, functions, charts and other excel commands. By
default a spreadsheet cell reference is relative cell reference. This means, the formula and
functions can be copied and posted to other cell. A relative cell consist of column letter and row
number and intersect at the cell location, An example of relative cell reference would be A1, B4,
G9 etc.

Absolute cell reference: In Excel, an absolute cell reference identifies the location of cell or
group of cell which also contain column letter and row number surrounded by dollar sign($). An
example of absolute cell reference would be $A$2, $G$9, $Z$345 etc. An easy way to add dollar
sign us to click on cell reference and then press “F4” key from keyboard. An absolute cell
reference is use when you want a cell reference to stay fixed on a specific cell, which means
formula and functions can be copied and posted to other cell the formula and function doesn't
change.

steps to open Microsoft Excel:


On Windows:
1. Click on the Start button (Windows icon) in the bottom-left corner.
2. Type "Excel" in the search bar.
3. Click on Microsoft Excel from the search results.
4. Alternatively, click the Excel icon if it's on your desktop or taskbar.
On Mac:
1. Open Finder and go to the Applications folder.
2. Find and double-click Microsoft Excel.

TO PREPARE MARKSHEET USING MS EXCEL


1. Open Excel and create a Blank Workbook.
2. Set up headers: In row 1, add columns like Student Name, Roll
3. Number, and subject names (e.g., Subject 1, Subject 2, etc.), and
4. Total Marks.
5. Enter student data: Fill in student names, roll numbers, and marks in each subject.
6. Calculate total marks: In the Total Marks column, use =SUM(C2:F2)
7. (adjust according to your subjects) to get the total for each student.
8. Calculate percentage (optional): In the next column, use =G2/
9. Total_Maximum_Marks *100 to calculate the percentage.
10. Format the sheet: Bold headers, adjust column widths, and add borders.
11. Save the file: Go to File > Save As, choose location, and save your marksheet.

Output:
Here are the key formulas in short for a marksheet:
1. Total Marks:
=SUM(C2:F2)
(Sum of marks from multiple subjects)
2. Percentage (Optional):
=G2/Total_Maximum_Marks*100
(Total marks divided by the maximum marks, multiplied by
100)
[Link] Marks (Optional):
=AVERAGE(C2:F2)
(Average of marks in subjects)
[Link] (Optional):
=IF(H2>=90,"A+", IF(H2>=80,"A", IF(H2>=70,"B",
IF(H2>=60,"C","F"))))
(Assign grades based on percentage)
These formulas can help you quickly calculate total marks,
percentages, and grades in your marksheet.

MS-Powerpoint (Presentation)
Power point is the presentation software in the Microsoft office suite, with power point we can
create dynamic and professional presentation by using pre-defined layouts, themes and
templates. Powerpoint includes all the features we need to produce professional looking
presentation. Powerpoint presentation consists of series of slides which contain information that
we want to communicate with our audience, This information can include text, image, graph,
charts, video, audio and many more. Presentation program can be used as a supplement of older
visual aid technology such as pamphlets, handouts, posters, chalkboard etc.
The extension of powerpoint file is “.ppt", later version use “.pptx”". Similarly magic point,
apple keynote, IBM lotus, Harvard graphics etc are the alternative software for Ms-Powerpoint.

Features of MS-Powerpoint.
 Formatting of data helps to make document much more attractive, effective and
interactive by using tools like font, font color, hyperlinks etc.
 Simple computing operation such as cut, copy, paste, find and replace are supported,
 It allows user to use pre-defined layout, themes and templates which helps in faster
development and design of presentation.
 Slide transition and effects can also be used for further requirement,
 We can create our own custom animation.
 It supports both internal and external hyperlink.
 Different bar, graphs, charts can be used to convey, detailed and precise information.
 Internet features such as web toolbar, online help, web linking can also be done.
Introduction to HTML
HTML stands for Hyper Text Markup Language which are used to create web pages that are
used in internet to exchange data and information. HTML file itself is a text file which contains
several tags and attributes. HTML was develop by Tim Berner Lee that was based on SGML
(Standard Generalized Markup Language). The tags and attributes used to create HTML file are
displayed using web browser. Web browser helps to understand all the tags and attributes given
by the user and generate the contain of the page. The different version of HTML are: HTML,
HTML+, HTML 1.0, HTML2.0, HTML3.2, HTML 4.01 and now HTML 5.0.

Use of HTML:
 It is used to create a basic layout or design of web page.
 Without HTML worldwide web wouldn't exist.
 It allows features like embedding images, videos, audio etc.
 It allows user to customize and format characters such as bold, italic, underline etc.
 It helps to create link and list.

Advantages of HTML:
 It is easy to use, flexible and user friendly.
 It can be supported by all the web browser and operating system such as Macintosh,
windows, unix etc
 It is easier to obtain and modify any of the content.
 It is compatible with all the search engine.
 There are several new and advance features in HTML 5.0.
 HTML file takes short period of time to load.
 Several tutorial can be easily accessed regarding HTML.

Disadvantage of HTML:
 It is difficult to create attractive and interactive webpages only using HTML. [php,
javascript, sql etc]
 It cannot be used to create dynamic webpages.
 It is only a scripting language and cannot be used as programming language.
 There are many incompatibilities of HTML.
 There is no any complete acceptable standard of HTML.

Tags
HTML tag are the instructions or command given to the web browser in order to organize text
image and any other components of web pages. This HTML tags are executed by web browser
respectively. Like any programming language this HTML tags also helps to perform some
specific actions. HTML tags are written inside angular brackets <> . There are two types of
HTML tag.
Let’s see a small example of a simple HTML page that displays the heading and paragraph
content:
<!DOCTYPE html>
<html>
<head>
<title>Simple HTML Page</title>
</head>
<body>
<h1>Welcome to GeeksforGeeks</h1>
<p>A computer science portal for geeks. By Prashamsa Kunwar</p>
</body>
</html>

Output:

HTML Formatting Elements


Formatting elements were designed to display special types of text:

 <b> - Bold text


 <strong> - Important text
 <i> - Italic text
 <em> - Emphasized text
 <mark> - Marked text
 <small> - Smaller text
 <del> - Deleted text
 <ins> - Inserted text
 <sub> - Subscript text
 <sup>Superscript text

Example
<!DOCTYPE html>
<html>
<body>
<p>This text is normal.</p>
<p><i>This text is italic.
By: Prashamsa Kunwar</i></p>
</body>
</html>

Output:

HTML <font> Tag

Example:
<!DOCTYPE html>
<html>
<body>
<p style="color:red">This is a paragraph.</p>
<p style="color:blue">This is another paragraph. By:Prashamsa Kunwar</p>
</body>
</html>

Output:

HTML Images
Images can improve the design and the appearance of a web page.
Example:
<!DOCTYPE html>
<html>
<body>
<h2>HTML Image
by: Prashamsa Kunwar</h2>
<img src="pic_trulli.jpg" alt="Trulli" width="500" height="333">
</body>
</html>

Output:
HTML Audio:
The HTML <audio> element is used to play an audio file on a web page.
Example:
<!DOCTYPE html>
<html>
<body>
<p> By Prashamsa Kunwar </p>
<audio controls>
<source src="[Link]" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>

Output:
HTML Links
Links are found in nearly all web pages. Links allow users to click their way from page to page.
Example:
<!DOCTYPE html>
<html>
<body>
<h1>HTML Links
by: Prashamsa Kunwar</h1>
<p><a href="[Link] [Link]!</a></p>
</body>
</html>Output:

Example:
<!DOCTYPE html>
<html>
<body>
<h2>The target Attribute by: Prashamsa Kunwar</h2>
<a href="[Link] target="_blank">Visit W3Schools!</a>
<p>If target="_blank", the link will open in a new browser window or tab.</p>
</body>
</html>
Output:
HTML Tables
HTML tables allow web developers to arrange data into rows and columns.

Example
<!DOCTYPE html>
<html>
<style>
table, th, td {
border:1px solid black;
}
</style>
<body>
<h2>A basic HTML table By:Prashamsa Kunwar</h2>
<table style="width:100%">
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
<p>To understand the example better, we have added borders to the table.</p>
</body>
</html>
Output:

HTML Lists
HTML lists allow web developers to group a set of related items in lists.

Example:
<!DOCTYPE html>
<html>
<body>
<h2>An unordered HTML list by: Prashamsa Kunwar</h2>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Output:

Example:
<!DOCTYPE html>
<html>
<body>
<h2>An ordered HTML list by:Prashamsa Kunwar</h2>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>

Output:
HTML <form> Tag
An HTML form with two input fields and one submit button

Example:
<!DOCTYPE html>
<html>
<body>
<h1>The form element
By: Prashamsa Kunwar</h1>
<form action="/action_page.php">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Submit">
</form>
<p>Click the "Submit" button and the form-data will be sent to a page on the
server called "action_page.php".</p>
</body>
</html>

Output:
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS) is used to format the layout of a [Link] CSS, you can
control the color, font, the size of text, the spacing between elements, how elements are
positioned and laid out, what background images or background colors are to be used, different
displays for different devices and screen sizes, and much more!

Using CSS
CSS can be added to HTML documents in 3 ways:
Inline - by using the style attribute inside HTML elements
Internal - by using a <style> element in the <head> section
External - by using a <link> element to link to an external CSS file
The most common way to add CSS, is to keep the styles in external CSS files. However, in this
tutorial we will use inline and internal styles, because this is easier to demonstrate, and easier for
you to try it yourself.

Inline CSS
 An inline CSS is used to apply a unique style to a single HTML element.
 An inline CSS uses the style attribute of an HTML element.
 The following example sets the text color of the <h1> element to blue, and the text color
of the <p> element to red.

Example:
<!DOCTYPE html>
<html>
<body>
<h1 style="color:blue;">A Blue Heading by: Prashamsa Kunwar</h1>
<p style="color:red;">A red paragraph.</p>
</body>
</html>
Output:

Internal CSS
An internal CSS is used to define a style for a single HTML page. An internal CSS is defined in
the <head> section of an HTML page, within a <style> element. The following example sets the
text color of ALL the <h1> elements (on that page) to blue, and the text color of ALL the <p>
elements to red. In addition, the page will be displayed with a "powderblue" background color:

Example:
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading by: Prashamsa Kunwar</h1>
<p>This is a paragraph.</p>
</body>
</html>
Output:

External CSS
An external style sheet is used to define the style for many HTML pages. To use an external
style sheet, add a link to it in the <head> section of each HTML page:

Example:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="[Link]">
</head>
<body>
<h1>This is a heading by: Prashamsa Kunwar</h1>
<p>This is a paragraph.</p>
</body>
</html>

Output:
C Introduction
What is C?
C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories
in 1972. It is a very popular language, despite being old. The main reason for its popularity is
because it is a fundamental language in the field of computer science. C is strongly associated
with UNIX, as it was developed to write the UNIX operating system.

Why Learn C?
It is one of the most popular programming languages in the world. If you know C, you will have
no problem learning other popular programming languages such as Java, Python, C++, C#, etc,
as the syntax is similar. C is very fast, compared to other programming languages, like Java and
Python. C is very versatile; it can be used in both applications and technologies

Difference between C and C++


C++ was developed as an extension of C, and both languages have almost the same syntax. The
main difference between C and C++ is that C++ supports classes and objects, while C does not.

Examples:
#include <stdio.h>
int main() {
printf("Hello World!by:Prashamsa Kunwar");
return 0;
}

Output:

Example 2:
#include <stdio.h>
int main() {
printf("Hello World! Prashamsa Kunwar")
return 0;
}
Output:

Example 3:
#include <stdio.h>
int main() {
printf(This sentence will produce an error. by: Prashamsa Kunwar);
return 0;
}
Output:

Example 4:
#include <stdio.h>
int main() {
printf("Hello World!");
printf("I am learning C.");
printf("And it is awesome!by:Prashamsa Kunwar");
return 0;
}
Output:

Example 5:
#include <stdio.h>
int main() {
printf("Hello World!\n");
printf("I am learning C. by: Prashamsa Kunwar");
return 0;
}
Output:

Example 6:
#include <stdio.h>
int main() {
printf("Hello World!\nI am learning C.\nAnd it is awesome! by:Prashamsa Kunwar");
return 0;
}
Output:
Example 7:
#include <stdio.h>
int main() {
printf("Hello World!\n\n");
printf("I am learning C. by:Prashamsa Kunwar");
return 0;
}
Output:

C Output
To output values or print text in C, you can use the printf() function:

Example 1:
#include <stdio.h>
int main() {
printf("Hello World!\n by:Prashamsa Kunwar");
return 0;
}
Output:
Example 2:
#include <stdio.h>
int main() {
// Create an integer variable that will store the number we get from the user
int myNum;
// Ask the user to type a number
printf("Type a number and press enter: \n");
// Get and save the number the user types
scanf("%d", &myNum);
// Print the number the user typed
printf("Your number is: %d", myNum);
return 0;
}Output:
Example 3:
#include <stdio.h>
int main() {
// Create an int and a char variable
int myNum;
char myChar;
// Ask the user to type a number AND a character
printf("Type a number AND a character and press enter: \n");
// Get and save the number AND character the user types
scanf("%d %c", &myNum, &myChar);
// Print the number
printf("Your number is: %d\n", myNum);
// Print the character
printf("Your character is: %c\n", myChar);
return 0;
}
Output:
The if Statement:
Use the if statement to specify a block of code to be executed if a condition is true.

Example:
#include <stdio.h>
int main() {
if (20 > 18) {
printf("20 is greater than 18 \n By: Prashamsa Kunwar" );
}
return 0;
}
Output:

The else Statement:


Use the else statement to specify a block of code to be executed if the condition is false.

Example 1:
#include <stdio.h>
int main() {
int time = 20;
if (time < 18) {
printf("Good day.");
} else {
printf("Good evening.\nby: Prashamsa Kunwar");
}
return 0;
}
Output:

Example 2:
#include <stdio.h>
int main() {
int number;
printf("Enter an integer: ");
scanf("%d", &number);
// true if number is less than 0
if (number < 0) {
printf("You entered %d.\n", number);
}
printf("The if statement is easy.\n by:Prashamsa Kunwar");
return 0;
}
Output:
Example 3:
#include <stdio.h>
int main() {
int number;
printf("Enter an integer: ");
scanf("%d", &number);
// True if the remainder is 0
if (number%2 == 0) {
printf("%d is an even integer.\nby:Prashamsa kunwar",number);
}
else {
printf("%d is an odd integer.",number);
}
return 0;
}
Output:
The else if Statement
Use the else if statement to specify a new condition if the first condition is false.

Example 1:
#include <stdio.h>
int main() {
int time = 22;
if (time < 10) {
printf("Good morning.");
} else if (time < 20) {
printf("Good day.");
} else {
printf("Good evening.\nby: Prashamsa kunwar ");
}
return 0;
}
Output:
Example 2:
#include <stdio.h>
int main(){
int number=5;
if(number==20){
printf("number is equals to 20");
}
else if(number==50){
printf("number is equal to 50");
}
else if(number==100){
printf("number is equal to 100");
}
else{
printf("number is not equal to 20, 50 or 100\nby: Prashamsa kunwar ");
}
return 0;
}
output:
Example 3:
#include <stdio.h>
int main() {
int No= 10;

if (No> 0 && No% 2 == 0) {


printf("Number is positive and even\n by: Prashamsa kunwar ");
}
else if (No> 0 && No% 2 != 0) {
printf("Number is positive and odd\n");
}
else if (No< 0) {
printf("Number is negative\n");
}
else {
printf("Number is zero\n");
}

return 0;
}
Output:
Nested if:
It is always legal in C programming to nest if-else statements, which means you can use one if or
else-if statement inside another if or else-if statement(s).
In the programming context, the term "nesting" refers to enclosing a particular programming
element inside another similar element. For example, nested loops, nested structures, nested
conditional statements, etc. If an if statement in C is employed inside another if statement, then
we call it as a nested if statement in C.

Example:
#include <stdio.h>
int main (){
// local variable definition
int a = 274;
printf("Value of a is : %d\n", a);
if (a < 100){
printf("Value of a is less than 100\n");
}
if (a >= 100 && a < 200){
printf("Value of a is between 100 and 200\n" );
}
if (a >= 200){
printf("Value of a is more than 200\nby: Prashamsa kunwar " );
Output:

BY : Prashamsa Kunwar
C Switch
Instead of writing many if..else statements, you can use the switch statement. The switch
statement selects one of many code blocks to be executed.

Example 1:
#include <stdio.h>

int main() {

int day = 4;

switch (day) {

case 1:

printf("Monday");

break;

case 2:

printf("Tuesday");

break;

case 3:

printf("Wednesday");

break;

case 4:

printf("Thursday\nby: Prashamsa Kunwar ");

break;

case 5:

printf("Friday");

break;

case 6:

printf("Saturday");

break;

case 7:

printf("Sunday");

break;

}
return 0;

Output:

Example 2:
#include <stdio.h>
int main() {
int day = 4;
switch (day) {
case 6:
printf("Today is Saturday");
break;
case 7:
printf("Today is Sunday");
break;
default:
printf("Looking forward to the Weekend\nby: Prashamsa Kunwar ");
}
return 0;
}
Output:
Example 3:
#include <stdio.h>
int main() {
// Switch variable
int var = 1;
// Switch statement
switch (var) {
case 1:
printf("Case 1 is Matched.\n Prashamsa Kunwar ");
break;
case 2:
printf("Case 2 is Matched.");
break;
case 3:
printf("Case 3 is Matched.");
break;
default:
printf("Default case is Matched.");
break;
}
return 0;
}
Output:
For Loop
When you know exactly how many times you want to loop through a block of code, use the for
loop instead of a while loop.

Example 1:
#include <stdio.h>
int main() {
int i;
for (i = 0; i < 5; i++) {
printf("%d\n", i);
}
printf("by: Prashamsa Kunwar \n");
return 0;
}
Output:
Example 2:
#include <stdio.h>
int main()
{
int num, count, sum = 0;
printf("Enter a positive integer: ");
scanf("%d", &num);
// for loop terminates when count exceeds num
for(count = 1; count <= num; ++count)
{
sum += count;
}
printf("Sum = %d\n", sum);
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Example 3:
#include <stdio.h>
int main() {
// for loop to print "Hi" 5 times
for (int i = 5; i < 10; i++) {
printf("Hi\n");
}
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
While Loop
The while loop loops through a block of code as long as a specified condition is true.

Example 1:
int main() {
int i = 0;
while (i < 5) {
printf("%d\n", i);
i++;
}
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Example 2:
#include <stdio.h>
int main() {
int i = 1;
// Condition for the loop
while (i <= 5) {
printf("GfG\n");
// Increment i after each iteration
i++;
}
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Example 3:
#include <stdio.h>
int main() {
int sum = 0, i = 1;
while (i <= 10) {
// Add the current value of i to sum
sum += i;
// Increment i
i++;
}
printf("%d\n", sum);
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
The Do/While Loop
The do/while loop is a variant of the while loop. This loop will execute the code block once,
before checking if the condition is true, then it will repeat the loop as long as the condition is
true.

Example 1:
#include <stdio.h>
int main() {
int i = 0;
do {
printf("%d\n", i);
i++;
}
while (i < 5);
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Example 2:
#include <stdio.h>
int main() {
// Loop variable declaration and initialization
int i = 0;
// do while loop
do {
printf("Geeks\n");
i++;
} while (i < 3);
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Example 3:
#include <stdio.h>
int main() {
// Declaring a false variable
bool c = false;
do {
printf("This is loop body.\n");
// False condition
} while (c);
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Break statement
You have already seen the break statement used in an earlier chapter of this tutorial. It was used
to "jump out" of a switch statement. The break statement can also be used to jump out of a loop.

Example:
#include <stdio.h>
int main() {
int i;
for (i = 0; i < 10; i++) {
if (i == 4) {
break;
}
printf("%d\n", i);
}
return 0;
}
Output:
Continue statement
The continue statement breaks one iteration (in the loop), if a specified condition occurs, and
continues with the next iteration in the loop.

Example:
#include <stdio.h>
int main() {
int i;
for (i = 0; i < 10; i++) {
if (i == 4) {
continue;
}
printf("%d\n", i);
}
return 0;
}
Output:
Goto statements
The goto statement in C allows the program to jump to some part of the code, giving you more
control over its execution. While it can be useful in certain situations, like error handling or
exiting complex loops, it’s generally not recommended because it can make the code harder to
read and maintain.

Example:
#include <stdio.h>
int main() {
int n = 0;
// If the number is zero, jump to
// jump_here label
if (n == 0)
goto jump_here;
// This will be skipped
printf("You entered: %d\n", n);
jump_here:
printf("Exiting the program.\n by: Prashamsa Kunwar ");
return 0;
}
Output:
Arrays
Arrays are used to store multiple values in a single variable, instead of declaring separate
variables for each value. To create an array, define the data type (like int) and specify the name
of the array followed by square brackets []

Example 1:
#include <stdio.h>
int main() {
int myNumbers[] = {25, 50, 75, 100};
printf("%d\n", myNumbers[0]);
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:

Example 2:
#include <stdio.h>
int main() {
int myNumbers[] = {25, 50, 75, 100};
myNumbers[0] = 33;
printf("%d\n", myNumbers[0]);
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Example 3:
#include <stdio.h>
int main() {
int myNumbers[] = {25, 50, 75, 100};
int i;
for (i = 0; i < 4; i++) {
printf("%d\n", myNumbers[i]);
}
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Example 4:
#include <stdio.h>
int main() {
// Declare an array of four integers:
int myNumbers[4];
// Add elements to it
myNumbers[0] = 25;
myNumbers[1] = 50;
myNumbers[2] = 75;
myNumbers[3] = 100;
printf("%d\n", myNumbers[0]);
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:
Example 5:
#include <stdio.h>
int main() {
// Trying to declare an array of both integers and floating point numbers
int myArray[] = {25, 50, 75, 3.15, 5.99};
int i;
for (i = 0; i < 5; i++) {
printf("%d\n", myArray[i]);
}
printf("by: Prashamsa Kunwar ");
return 0;
}
Output:

Example 6:
#include <stdio.h>
int main() {
int myNumbers[] = {10, 25, 50, 75, 100};
printf("%lu", sizeof(myNumbers));
return 0;
}
Output:

Strings
Strings are used for storing text/charactersFor example, "Hello World" is a string of characters.
Unlike many other programming languages, C does not have a String type to easily create string
variables. Instead, you must use the char type and create an array of characters to make a string
in C.

Example 1:
#include <stdio.h>
int main() {
char greetings[] = "Hello World!";
printf("%s", greetings);
return 0;
}
Output:

Example 2:
#include <stdio.h>
int main() {
char greetings[] = "Hello World!";
printf("%c", greetings[0]);
return 0;
}
Output:

Example 3:
#include <stdio.h>
int main() {
char greetings[] = "Hello World!";
greetings[0] = 'J';
printf("%s", greetings);
return 0;
}
Output:

Example 4:
#include <stdio.h>
int main() {
char carName[] = "Volvo";
int i;
for (i = 0; i < 5; ++i) {
printf("%c\n", carName[i]);
}
return 0;
}
Output:
Example 5:
#include <stdio.h>
int main() {
char greetings[] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\0'};
char greetings2[] = "Hello World!";
printf("%s\n", greetings);
printf("%s\n", greetings2);
return 0;
}
Output:

Example 6:
#include <stdio.h>
int main() {
char greetings[] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\0'};
char greetings2[] = "Hello World!";
printf("%lu\n", sizeof(greetings));
printf("%lu\n", sizeof(greetings2));
return 0;
}
Output:

CONCLUSION:
By preparing this project I came to know about different topics like Word processing, MS-Excel,
MS-power-point, and Web-page Designing. I learnt the different features of Word, Excel and
Web-page designing. Using Word, I learnt to prepare my bio-data, prepare different
mathematical symbols and prepare the certificate and ID card. I also learnt to mail merge. Using
Excel, I learnt to prepare mark-sheet, salary-sheet, sales records, and pie chart along with bar
graph. I also learnt to prepare the power-point presentation. I also learnt to prepare the webpage.
I came to know about the different facilities provided by web-page designing. I felt very glad
while preparing this report.

BIBLIOGRAPHY:
Dangi, Roshan (2022), A Text Book of Computer Science-XI, Heritage Publication

WEB REFERENCES:
1. [Link]
2. [Link]
3. [Link]

You might also like