C++ Fundamentals

  • Uploaded by: Mahathir Mohmed
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View C++ Fundamentals as PDF for free.

More details

  • Words: 323
  • Pages: 7
LAB 1.1 & 1.2 LAB EXERCISES 1. Use four cout statements to print the pattern of asterisks shown * ** *** **** 2. Write a program that produces the following output: CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ ++++++++++++++ CC ++++++++++++++ ++++++++++++++ CC ++ ++ CCCCCCCCC ++ ++ 3. Create a program that allow user to enter the numbers and this programs will prints the numbers vertically. 4. Create a program that allow user to enter 10 numbers and this program will prints the first and the last one on one line, the second and the ninth on the next line, the third and the seventh on the next line and so forth.

ANSWER Question 1: source code /* Author : xxx Description: Lab 1.1 & 1.2 Date : 3 January 2008 */ #include #include void main () {//open main cout<<"*"<<endl; cout<<"**"<<endl; cout<<"***"<<endl; cout<<"****"<<endl<<endl; system ("pause"); }//end main console application

Question 2: source code /* Author : xxx Description: Lab 1.1 & 1.2 Date : 3 January 2008 */ #include #include void main () {//open main

system ("pause"); }//end main console application

Question 3: source code /* Author : xxx Description: Lab 1.1 & 1.2 Date : 3 January 2008 */ #include #include void main () {//open main float num1,num2,num3,num4,num5; //get input cout<<"\nEnter Number:"; cin>>num1; cout<<"\nEnter Number:"; cin>>num2; cout<<"\nEnter Number:"; cin>>num3; cout<<"\nEnter Number:"; cin>>num4; cout<<"\nEnter Number:"; cin>>num5; //print output cout<<"\n....................."<<endl<<endl; cout<
console application

Question 4: source code /* Author : xxx Description: Lab 1.1 & 1.2 Date : 3 January 2008 */ #include #include void main() {//open main float num1,num2,num3,num4,num5,num6,num7,num8,num9,num10; //get input cout<<"\nEnter Number:"; cin>>num1; cout<<"\nEnter Number:"; cin>>num2; cout<<"\nEnter Number:"; cin>>num3; cout<<"\nEnter Number:"; cin>>num4; cout<<"\nEnter Number:"; cin>>num5; cout<<"\nEnter Number:"; cin>>num6; cout<<"\nEnter Number:"; cin>>num7; cout<<"\nEnter Number:"; cin>>num8; cout<<"\nEnter Number:"; cin>>num9; cout<<"\nEnter Number:"; cin>>num10;

//show output cout<<"\n..........................."<<endl<<endl; cout<

Related Documents

C++ Fundamentals
November 2019 14
C Sharp Fundamentals
June 2020 7
Fundamentals
November 2019 61
Fundamentals
May 2020 25
Fundamentals
October 2019 60

More Documents from ""

Green Quotes
December 2019 28
December 2019 36
Root Explant
November 2019 31
Botox
November 2019 32