0% found this document useful (0 votes)
4 views4 pages

Lab 1

The document outlines the first lab for HSC Batch 2025, focusing on programming in C. It details the necessary software, tools, and processes for writing, compiling, and running a C program that calculates the sum and average of three numbers. Additionally, it includes explanations of various programming concepts and functions used in C programming.

Uploaded by

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

Lab 1

The document outlines the first lab for HSC Batch 2025, focusing on programming in C. It details the necessary software, tools, and processes for writing, compiling, and running a C program that calculates the sum and average of three numbers. Additionally, it includes explanations of various programming concepts and functions used in C programming.

Uploaded by

mukulgain87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

HSC Batch 2025

Lab No: 1 Date:


Lab Name: wZbwU msL¨vi †hvMdj I Mo wbY©q Kivi Rb¨ GKwU wm †cÖvMÖvg wjL|

ZË¡ (Theory): ‡cÖvMÖv‡g †Kvb G·‡cÖkb wKsev dvsk‡bi †k‡l hLb †mwg‡Kvjb (;) †`qv nq, ZLb wm fvlvq †m÷‡g›U ejv
nq| ‡cÖvMÖv‡g †WUv Z_v †fwi‡qe‡ji gvb MÖnY Kivi Rb¨ e¨eüZ †m÷‡g›U‡K BbcyU †m÷‡g›U ejv nq| Kx-‡evW© †_‡K w÷ªs
RvZxq †WUv Bbcy‡Ui Rb¨ wm-‡Z K‡qK ai‡bi †m÷‡g›U e¨envi Kiv nq| h_v- scanf(), getc(), gets(),
getchar() BZ¨vw`| ‡cÖvMÖv‡g †WUv Z_v †fwi‡qe‡ji cÖ`k©b Kivi Rb¨ e¨eüZ †m÷‡g›U‡K AvDUcyU †m÷‡g›U ejv nq|
Kx-‡evW© †_‡K w÷ªs RvZxq †WUv cÖ`k©‡bi Rb¨ wm-‡Z K‡qK ai‡bi †m÷‡g›U e¨envi Kiv nq| h_v- printf(),
putc(), puts(), putchar() BZ¨vw`|

‡hvMdj: msL¨v wZbwUi Rb¨ †fwi‡qej x, y, z Ges †hvMdj I Mo wbY©q Kivi Rb¨ h_vµ‡g sum,avg †fwi‡qej
†NvlYv Kwi| ‡cÖvMÖv‡g ‡WUv BbcyU †`qvi Rb¨ scanf(); dvskb e¨envi Kwi| †hvMdj I Mo wbY©q Kivi Rb¨
digyjv sum = x + y + z; Ges avg = sum/avg; UvBc Kwi| AvDUcyU cÖ`©kb Kivi Rb¨
printf(); dvskb e¨envi Kwi|

cÖ‡qvRbxq nvW©Iq¨vi: GKwU Kw¤úDUvi (Computer)

cÖ‡qvRbxq mdUIq¨vi:

1. Acv‡iwUs wm‡÷g (Operating System) – DB‡ÛvR (Windows)


2. †U·U GwWUi (Text Editor/IDE) – ‡KvWeøKm (CodeBlocks)

e¨eüZ †cÖvMÖvwgs fvlv ( Programing Language): wm †cÖvMÖvwgs (C Programing )

hš¿cvwZi e¨envi (Uses of Device):

1. cÖ_‡g Kw¤úDUv‡i we`y¨r ms‡hvM †`B


2. UPS Ab Kwi (hw` _v‡K)
3. Monitor Ges CPU Gi Power Button G ‡cÖm (Press) K‡i Kw¤úDUvi Ab Kwi
4. cÖ‡qvRbxq mKj ai‡bi Software Install Av‡Q wK bv †`‡L †bB, bv _vK‡j Install Kwi|
cÖwµqv AbymiY (Process):
1. cÖ_‡g Start > CodeBlocks > CodeBlocks wb‡`©k w`‡q CodeBlocks Open Kwi|
CodeBlocks Open n‡j File → New → Empty File wb‡`©k w`‡q A_ev
Ctrl + N, ‡cÖm (Press) K‡i GKwU File ‰Zwi Kwi|
2. File > Save A_ev Ctrl + S, ‡cÖm (Press) K‡i C Program File wU Lab -1 HSC Batch 2025.c
bvg w`‡q Desktop G Save Kwi| wb‡Pi wbq‡g C Program ‰Zwi Kivi Rb¨ cÖ‡qvRbxq †KvW UvBc
Kwi|

Lab -
1 HSC Batch 2025.c
Compile: Build > Build wb‡`©k w`‡q A_ev Ctrl + F9, ‡cÖm (Press) K‡i ‡cÖvMÖvg Compile Kwi|
‡cÖvMÖv‡g †Kvb fzj _vK‡j ms‡kvab K‡i Save Kwi, bv _vK‡j ‡cÖvMÖvg Run Kwi|
Run Ges djvdj:
Build > Run wb‡`©k w`‡q A_ev Ctrl + F10, ‡cÖm (Press) K‡i ‡cÖvMÖvg Run Kwi| cÖ‡qvRbxq †WUv BbcyU w`‡q
Enter ‡cÖm (Press) Kwi| Zvn‡j wb‡Pi djvdj cvIqv hv‡e --
e¨vL¨v (Description):
U¨v‡Mi bvg KvR/e¨vL¨v
/*------*/ WKz‡g‡›Ukb †mKkb| †cÖvMÖv‡gi wewfbœ welq eY©bv Kivi Rb¨|
# Compiler Derivative
#include ‡nWvi dvB‡ji mv‡_ wjsK ¯’vcb Kivi Rb¨|
<stdio.h> ÷¨vÛvW© BbcyU/AvDUcyU dvskb e¨envi Kivi Rb¨|
main() cÖwZwU †cÖvMÖv‡gi Avek¨Kxq dvskb|
{ } †cÖvMÖv‡gi wbe©vn‡hvM¨ Ask| cÖwZwU dvsk‡bi ïiæ I ‡kl †evSv‡Z|
int Bw›URvi †WUv †NvlYv Kivi Rb¨|
X, Y, Z, sum, avg cÖ‡qvRbxq †fwi‡qej ev PjK †NvlYv Kivi Rb¨|
\t AvDUcyU Wvb w`‡K GK U¨ve `~iæ‡Z¡ cÖ`©k‡bi Rb¨ |
\n bZzb jvBb ˆZwii Rb¨/AvDUcyU bZzb jvB‡b cÖ`©k‡bi Rb¨|
%d `kwfwËK c~Y©msL¨vi †WUv †evSv‡bvi K‡›Uªvj|
& Address Operator, Pj‡Ki wVKvbv Rvbvi Rb¨ e¨envi Kiv nq|
(Variable’s Memory Address)
printf() gwbUi ev AvDUcyU w¯‹‡b †Kv‡bv wKQz cÖ`k©b Kivi Rb¨|
scanf() Kx-‡ev‡W©i gva¨‡g †WUv BbcyU †bIqvi Rb¨|
return ‡Kv‡bv dvskb ‡_‡K †ewi‡q Avmvi Rb¨ e¨envi Kiv nq| A_©vr dvskb
†Kv‡bv wKQz wiU©vb Ki‡e wK bv †mUv wba©vi‡Y return wKIqvW© e¨envi
Kiv nq|
; dvskb ev †m÷‡g›U ev G·‡cÖkb Uviwg‡bUi|
=, +, / Acv‡iUi|
X, Y, Z, sum, avg Acv‡iÛ|

You might also like