0% found this document useful (0 votes)
50 views6 pages

Microsoft Visual C++ 6.0: Rheabelle Joyce S. Uy Mr. Regienald Pura IT-Afternoon

This document contains 6 code snippets written in C++ using Visual Studio 6.0. The code snippets demonstrate basic C++ programs that: 1) create a multiplication table, 2) determine if a number is even or odd, 3) add two numbers, 4) create a pattern using nested for loops, and 5) check if a year is a leap year. Each snippet includes header files, input/output statements, and conditionals or loops to perform calculations or display output.

Uploaded by

Regienald Pura
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views6 pages

Microsoft Visual C++ 6.0: Rheabelle Joyce S. Uy Mr. Regienald Pura IT-Afternoon

This document contains 6 code snippets written in C++ using Visual Studio 6.0. The code snippets demonstrate basic C++ programs that: 1) create a multiplication table, 2) determine if a number is even or odd, 3) add two numbers, 4) create a pattern using nested for loops, and 5) check if a year is a leap year. Each snippet includes header files, input/output statements, and conditionals or loops to perform calculations or display output.

Uploaded by

Regienald Pura
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Microsoft

Visual
C++ 6.0

Rheabelle Joyce S. Uy
Mr. Regienald Pura
IT-Afternoon
#include<iostream.h>
#include<windows.h>
int main()
{
SetConsoleTitle("Multi[lication Table");
int num;
cout<<"Enter Number:";
cin>>num;
for(int a=1;a<=10;a++)
cout<<num<<"*"<<a<<"="<<num*a<<endl;
return 0;
}
#include<iostream.h>
#include<windows.h>
int main()
{
SetConsoleTitle("Odd and Even");
int n;
cout<<"Enter Number:";
cin>>n;
if(n%2==0)
{
cout<<n<<"is even:";
}
else
{
cout<<n<<"is odd:";
}
return 0;
#include<iostream.h>
#include<windows.h>
void main()
{
SetConsoleTitle("Add Two Numbers");
double num1,num2,result;
cout<<"First Number:";
cin>>num1;
cout<<"Second Number:";
cin>>num2;
result=num1+num2;
cout<<"\nAddition is:";
cout<<result;
}
#include<iostream.h>
#include<windows.h>
void main()
{
SetConsoleTitle("Pattern");
double num,c,k;
cout<<"Enter number of rows:";
cin>>num;
cout<<"\n";
for(c=1;c<=num;c++)
{
for(k=1;k<=c;k++)
{
cout<<c;
}
cout<<"\n";
}
#include<iostream.h>
#include<windows.h>
int main()
{
SetConsoleTitle("Leap Year");
int year;
cout<<"Enter Year:";
cin>>year;
if(year%4==0||year%400==0||year%100==0)
cout<<"This is a leap year"<<endl;

else
cout<<"This is not a leap year"<<endl;

return 0;
}

You might also like