You are on page 1of 3

Name: RAVEN M.

BERCASIO
Section: BSIT M21
Subject: COMPRO1

Day 3 Activity
Program 5

#include<iostream.h>
#include<conio.h>

main()

{
clrscr();
int age;

age = 16;
cout<<"My age is"<<age;
getch();
return 0;
}

Program 6

#include<iostream.h>
#include<conio.h>

int main()
{

clrscr();
char ch;
ch= 'A';
cout<<ch;
ch='B';
cout<<ch;

getch();
return 0;
}
Program 7

#include<iostream>
#include<string>

using namespace std;

int main()
{

string mystring;
cout<<"What is your name? ";
cin>>mystring;
cout"Hello"<<mystring<<".\n";
cout<<"What is your favorite band? "
cin><mystring
cout<<" I like"<<mystring<<"too\n";

return 0;
}
Program Error Encountered Modified Codes Output
No.
(Syntax/Logical Error)

getch(); Add "using namespace std;"

5 main() Add "int main()"

cout<<" My age is "<<age;


clrscr();

#include<conio.h>

#include<iostream.h> #include<iostream>

Add "using namespace std;"


6 #include<conio.h>

clrscr();

getch();

cout"Hello"<<mystring<<".\n"; cout<<"Hello"<<mystring<<".\n";

7
cout<<"What is your favorite band? "
cout<<"What is your favorite
band? ";
cin><mystring

cin>>mystring;

Add space " Hello ", " I like ", and


" too"

You might also like