Home
Welcome To The Programming Page Of 2k1CP
All the given programs are thoroughly
checked & debugged and there is full guarantee for each and every program
execution.
LAB#1
(a)
#include<iostream.h>
void main(void)
{
cout<<"Welcome to the world of C++"<<endl;
}
(b)
#include<iostream.h>
void main(void)
{
cout<<"Welcome to the world"
<<"of C++"<<endl;
}
(c)
#include<iostream.h>
void main(void)
{
cout<<"Welcome\n to the \n world"
<<"of C++"<<endl;
}
Solution#4: -
(a)
#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
cout<<"welcome \tto\tthe\n\tworld\tof\n\t\tC++";
getch();
}
(b)
#include<iostream.h>
#include<conio.h>
void main(void)
{ clrscr();
cout<<"welcome\nto\nthe\nworld\nof\nc++";
getch();
}
(c)
#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
cout<<"welcome\n\tto\n\t\tthe\n\t\t\tworld\n\t\t\t\tof\n\t\t\t\t\tC++";
getch();
}
(d)
This program is different for every student & so not done by
us.
LAB # 2
Solution# 1
#include<iostream.h>
#include<conio.h>
void main(void)
{clrscr();
int variable1,variable2,variable3;
cout<<"Enter two integers to be added..."<<endl;
cin>>variable1>>variable2;
variable3=variable1+variable2;
cout<<"Sum of two integers entered ="<<variable3;
getch();
}
Solution# 2
#incl<iostreXX.h>
void main(void)
{
cout<<"try \n"<<endl;
}
Solution # 3
(a)
#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
cout<<"the backslash at the end of the line can be\
used to extend a string from one line to the\
next line.";
getch();
}
(b)
#\
include<iostream.h>
int mai\
n(
vo\
id)
{
cout\
t<\
<"see if\
this works?\n"\
;
}
Solution # 4
#include<iostream.h>
#include<conio.h>
void main(void)
{ clrscr();
int variable1,variable2,variable3,variable4,variable5;
cout<<"Enter two integrs to be added..\n";
cin>>variable1>>variable2;
variable3=variable1+variable2;
variable4=variable1-variable2;
variable5=variable1*variable2;
cout<<"Sum of two integers="<<variable3<<endl;
cout<<"Prouct of two integers entered="<<variable5<<endl;
cout<<"Difference of two integers entered="<<variable4<<endl;
getch();
}
LAB # 3
Solution # 2
#include<iostream.h>
#include<conio.h>
void main(void)
{ clrscr();
int i=0;int j;
cout<<"i="<<i<<"\tj="<<j<<endl;
i=10;j=20;
cout<<"i="<<i<<"\tj="<<j<<endl;
getch();
}
Solution # 3
#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
cout<<"\a";
cout<<"Welocme to";
cout<<"\b";
cout<<"C++";
cout<<"\n";
cout<<"Welcome";
cout<<"\r";
cout<<"to";
cout<<"\t";
cout<<"C++\n";
cout<<"\73 073 \a";
cout<<"\a \Welcome to \bC++Welcome \rto C++\n";
getch();
}
Solution # 4
(b)
#include<iostream.h>
#include<conio.h>
void main(void)
{clrscr();
cout<<"\n\n\n\t\t\t\xc9\xcd\xcd\xcd\xcd\xcd\xbb\n";
cout<<"\t\t\t\xba\Fahad\xba\n";
cout<<"\t\t\t\xc8\xcd\xcd\xcd\xcd\xcd\xbc\n";
getch();
}
Solution # 5
#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
int i=10;
cout<<i<<endl;
cout<<hex<<i<<endl;
cout<<oct<<i<<endl;
getch();
}
Labs from 1-3 are on this page.
Wanna query about any
program or suggestions. Mail us on : -
[email protected]
©2001.All rights reserved by www.2k1cp.com.