Professional Documents
Culture Documents
Lab 1
Lab 1
Learning Outcomes
By the end of this lab, student should be able to:
Describe the structure of C++ programs
Write, compile and run simple C++ programs
Identify and correcting errors in the program
Question 1– 5 marks
Write C++ program below. Get the output.
#include <iostream.h>
void main()
{
cout<<"Welcome ";
cout<<"to Politeknik Kuala Terengganu "<< endl;
cout<<endl<<endl<<"PKT is a ";
cout<<"\n 12 polytechnic in Malaysia"<<endl;
}
Question 2– 5 marks
**************************************************************************
C++ is a new language was developed by Bjarne Stroustrup
and was called C++. Stroustrup states that
the purpose of C++ is to make writing good programs
easier and more pleasant for the individual programmer.
*************************************************************************
Question 3 – 5 marks
Identify errors from given program below. Correct them and get the output.
#include<iostream>
void main()
{
char name;
age;
Question 4– 5 marks