What's new

Closed Help

Status
Not open for further replies.
Joined
Nov 3, 2015
Posts
151
Reaction
16
Points
115
Age
24
Write a program that calculates and produce these two columns sequence number using the three looping statements :

sequence no.
1
2
3
4
5
squared
1
4
9
16
25
 
int main()
{
int j; //define a loop variable

for(j=1; j<5; j++) //loop from 1 to 6,
cout << j * j << " "; //displaying the square of j
cout << endl;
return 0;
}

output
1
4
9
16
25
*****************************************************
try mo nga po yan..wala c++ pc ko weh

int number = 1;
while(number <= 5)
{
cout << number << endl;
number = number + 1;
}

output
1
2
3
4
5
**********************
try mo po..then edit mo na lang po

TheScript check mo nga kung tama :hilarious::hilarious:
 
int main()
{
int j; //define a loop variable

for(j=1; j<5; j++) //loop from 1 to 6,
cout << j * j << " "; //displaying the square of j
cout << endl;
return 0;
}

output
1
4
9
16
25
*****************************************************
try mo nga po yan..wala c++ pc ko weh

int number = 1;
while(number <= 5)
{
cout << number << endl;
number = number + 1;
}

output
1
2
3
4
5
**********************
try mo po..then edit mo na lang po

TheScript check mo nga kung tama :hilarious::hilarious:
san po ilalagay yang output pa code nga po yung buo baguhan lng po kase
 
:dead:

lagay mo lang yung umpisa na

#include.iostream yata
#conio.h

yung ganyan..nalimutan ko na weh..try mo muna irun
 
#include <stdio.h>
#include <conio.h>

main()

{

int num, squ;

num = 0;

squ = num * num;

printf("\nnumber\tsquare\n");

printf("%d\t%d\t%d\n\n", num, squ);

getch();

return 0;
}

try mo nga yan
 
Last edited by a moderator:
#include <iostream>
using namespace std;
int main()
{
int i;
for(i=0; j<5; i++)
cout <<i<< “ “;
cout << \n;
return 0;
}

output
1
2
3
4
5



*****************************


#include <iostream>
using namespace std;
int main()
{
int j;
for(j=1; j<6; j++)
cout << j * j << “ “;
cout << \n;
return 0;
}

Here’s the output:
0
1
4
9
16
25


irun mo pareho yan
 
// fordemo.cpp
// demonstrates simple FOR loop
#include <iostream>
using namespace std;

int main()
{
int j; //define a loop variable

for(j=0; j<15; j++) //loop from 0 to 14,
cout << j * j << " "; //displaying the square of j
cout << endl;
return 0;
} Counter Strike :)
 
Salamat po nagawa ko na po mag Isa pero Try ko rin po yung mga SUGGEST nyo para lalo ako matuto SALAMAT mga ka PHC . SALUDO ako sa inyo gagaling nyo grabe :)
 
Dear rapandreifontaron,

Since 2 years have passed since the last reply in this thread, I am locking it to prevent necroposting. Feel free to start a new thread or contact any forum staff if you want this to be reopened.

Thread closed.
 
Status
Not open for further replies.

Similar threads

Back
Top