Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

Need help( here are the code with output)

Rating
-
Sold
-
Pages
54
Uploaded on
06-02-2025
Written in
2024/2025

"My document is a structured representation of information that reflects my thoughts, research, or work on a specific topic. It conveys key ideas, analysis, and findings in a clear and organized manner.

Institution
Course

Content preview

PSP LAB




1. Write C Program to Print hello.

Input
#include<stdio.h>
#include<conio.h>
int main()
{
Clrscr();
print("HELLO FY BSC CS");
getch();
}


OUTPUT




2. Write C Program to add, subtract, and multiply ad divide two numbers.




1. Program:Write a code for Addition(sum)

#include<stdio.h>
#include<conio.h>
int main()
{
int n1,n2,sum;
n1=200;
n2=500;
sum=n1+n2;
printf("\nsum=%d",sum);
getch();
}
Output:
sum = 700

2. Program:Write a code for Subtraction


Page 1

, PSP LAB



#include<stdio.h>
#include<conio.h>
int main()
{
int n1,n2,Sub;
n1=200;
n2=500;
Sub=n1-n2;
printf("\nSub=%d",Sub);
getch();
return 0;
}
Output:
Sub= -300




3. Program:Write a code for Multiplication
#include<stdio.h>
#include<conio.h>
int main()
{
int n1,n2,Mul;
n1=200;
n2=500;
Mul=n1*n2;
printf("\nMul=%d",Mul);
getch();
return 0;
}
Output:
Mul= -31072

4. Program:Write a code for Division
#include<stdio.h>
#include<conio.h>

Page 2

, PSP LAB



int main()
{
int n1,n2,Div;
n1=200;
n2=600;
Div=n1/n2;
printf("\nDiv=%d",Div);
getch();
}
Output:
Div= 0;




3. Write steps for Writing and Running C program.

Steps :-
1.C PROGRAM RUN’s IN TURBOC3
2.Click TurboC++ Icon on Desktop
3.It will open C EDITOR
4.Click alt+F
5.Click NEW
6.Start Typing the Program in Editor

SAVING C PROGRAM

Click alt+F
With Arrow Keys go to Option Save
Save Window Will Open
 Save The Program Name
 C:\TURBOC3\BIN\addition.C
And Press Enter
Your Prgram Will Be Saved

Compiling AND Running C Program

Press alt+c & Enter [ to compile the program ]
If any Error Exists try to remove the error and save the Program
For Running the Program Click alt+R & ENTER


Page 3

, PSP LAB



Output will be there on the Screen




4. Write a c Program to create calculator by accepting two numbers and perform addition
subtraction, multiplication, division and modulus operation.




Program:Write a code to create Calculator
#include<stdio.h>
#include<conio.h>
int main()
{
int n1,n2,Sum,Sub,Mul,Div;
printf("\nEnter two numbers:");
scanf("\n%d",&n1);
scanf("\n%d",&n2);
printf("\nSum=%d", n1+n2);
printf("\nSub=%d", n1-n2);
printf("\nMul=%d", n1*n2);
printf("\nDiv=%d", n1/n2);
getch();
return 0;
}


Output:
Enter two numbers: 50
20
Sum=70
Sub=30
Mul=1000
Div=2

Page 4

Written for

Institution
Course

Document information

Uploaded on
February 6, 2025
Number of pages
54
Written in
2024/2025
Type
OTHER
Person
Unknown

Subjects

$20.16
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
addysaifi

Get to know the seller

Seller avatar
addysaifi Azam campus
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions