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

"Stdafx.h" : #Include #Include Using Namespace Int Int

This document contains code for 5 programs: 1) A multiplication table program that takes user input for a number and limit. 2) A program that prints increasing asterisk patterns from 1 to 6 lines. 3) A program that takes 10 user inputs and counts positive, negative, and zero values. 4) A program that prints the character 'c' 15000 times. 5) A program that checks if a 3-digit number is an Armstrong number.

Uploaded by

Iqra Imtiaz
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)
33 views6 pages

"Stdafx.h" : #Include #Include Using Namespace Int Int

This document contains code for 5 programs: 1) A multiplication table program that takes user input for a number and limit. 2) A program that prints increasing asterisk patterns from 1 to 6 lines. 3) A program that takes 10 user inputs and counts positive, negative, and zero values. 4) A program that prints the character 'c' 15000 times. 5) A program that checks if a 3-digit number is an Armstrong number.

Uploaded by

Iqra Imtiaz
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

// ConsoleApplication2.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
int a,i,x;
cout << "enter number" << endl;
cin >> a;
cout << "enter limit" << endl;
cin >> i;
for (x = 10;x >= 1;x--)
{
cout << a << "*" << x << "=" << (x*a) << endl;
}

system("pause");
return 0;
}
// ConsoleApplication3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
for (int i = 1;i <= 6;i++)

{
for (int j = 1;j <= i; j++)
{
cout << "*";
} cout << endl;
}
system("pause");
return 0;
}

// ConsoleApplication3.cpp : Defines the entry point for the console application.


//

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
int x;
int c_p = 0;
int c_n = 0;
int c_z = 0;

for (int i = 1;i <= 10;i++)


{
cin >> x;
if (x == 0)
c_z++;
if (x > 0)
c_p++;
if (x < 0)
c_n++;

}
cout <<"Positive values are: "<<c_p << endl <<"Negative values are: "<< c_n <<
endl <<"zero values are: "<< c_z << endl;
system("pause");
return 0;
}
// ConsoleApplication3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
char ch = 1;
for (int i = 1; i <= 15000;i++)
{ cout << ch;
}
system("pause");
return 0;
}
// ConsoleApplication3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
int n, d1, d2, d3, temp;
for (n = 100; n <= 999; n++)
{
d1 = n % 10;
temp = n / 10;
d2 = temp % 10;
d3 = temp / 10;
int z;
z = (d1*d1*d1) + (d2*d2*d2) + (d3*d3*d3);
if (n == z)
cout << n << endl;

system ("pause");
return 0;
}

You might also like