0% found this document useful (0 votes)
2 views

CSI_Pract_1_2

The document lists various C++ and Visual Basic programs aimed at teaching fundamental programming concepts such as basic arithmetic, conditional statements, loops, and functions. Each program includes an aim, problem statement, and source code for implementation. The document serves as a guide for learners to practice and verify their coding skills.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

CSI_Pract_1_2

The document lists various C++ and Visual Basic programs aimed at teaching fundamental programming concepts such as basic arithmetic, conditional statements, loops, and functions. Each program includes an aim, problem statement, and source code for implementation. The document serves as a guide for learners to practice and verify their coding skills.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

List of Programs

Expt. Name of the Program


No.

1 C++ Basics :Sum and


difference of numbers
2 Conditional statements in
C++
3 Loop statements in C++

4 Switch Case: Display the

e
Day

un
5 Functions in C++

n ,P
6 Function Overloading

ga
be
7 Function calling: Call by
m
reference & Call by value
,A

8 Recursive Functions
r.)

9 Arrays in C++
(J
&C

10 Visual Basic: Area of a circle


AS

11 Sum of numbers using loops


O

12 Calculator Application
SC

1
SECTION-I C++ Programming

Program no. 1

Aim : To study basic structure of a C++ program


Problem statement

• Write a program in c++ that adds and subtracts the given two numbers and
display the sum and difference.
• Enter the program and verify the execution of the same on the computer.
Source program

e
#include <iostream.h>

un
#include <conio.h>

,P
void main ()
{

n
ga
int a,b,c,d;
clrscr ();
be
cout<<"Enter value of a := ";
m
cin>>a;//4
,A

cout<<"Enter value of b := ";


cin>>b; //7
r.)

c=a+b
(J
&C

cout << "The sum is : -"<<c; 11


d=a-b
AS

cout <<"\n "The difference is : -"<<d; -3


getch();
O

}
SC

2
Program no. 2

Aim : To study if else construct in C++.


Problem statement

Write a program in c++

1) To find the greater number between two numbers


2) To check the given number is divisible by 9.
Enter the program and verify the execution of the same on the computer.
Source program
#include <iostream.h>
#include <conio.h>

e
void main ()

un
{
int a,b;

,P
clrscr ();

n
cout<<"Enter value of a := ";

ga
cin>>a;//4 be
cout<<"Enter value of b := ";
cin>>b; //7
m
,A

if(a>b) //condition
r.)

{
(J

cout<<”a is greater than b”;


}
&C

else
AS

{
cout<<”b is greater than a”;
O

}
SC

Explanation
Is(condition) is true
Execute the code
Otherwise
Execute the another code

3
include <iostream.h>
#include <conio.h>
void main ()
{
int a,r;
clrscr ();
cout<<"Enter value of a := ";
cin>>a;//4
r=a%9; //remainder

if(r==0) //condition
{
cout<<”a is divisible by 9”;
}

e
else

un
{

,P
cout<<”a is not divisible by 9”;
}

n
ga
}
be
m
,A
r.)
(J
&C
AS
O
SC

You might also like