🔒 Closed Mga c++ programmer pa help naman po

Status
Not open for further replies.

IIZeroHourII

Eternal Poster
Sa mga may kaya po Pa help po guys di ko po ma solve ehh. Wala din po ako makita sa google mga tutorial..

(1 for loops and 2 if statement lang daw po gagamitin. or 2 for loops and 1 if statement..)

1-10 = 55 (e.g: 1+2+3+4+5+6+7+8+9+10 = 55)
11-20
21-30 = 255
31-40
41-50 = 455
51-60
61-70 = 655
71-80
81-90 = 855
91-100

55+255+455+655+855 = 2275 (ung 2275 lang po mismo ang lalabas na sagot pag ni run na ung code)

sana po may makatulong mga ka PHC. Salamat sa tutulong
 
ito na yung code. pasensya natagalan sa cp ko kasi ginawa. run mo ito ikaw na bahala sa disenyo. spoonfed ko na nga. ikaw na bahala diyan.

#include <iostream> using namespace std; int main() { int sum = 0; int totalSum = 0; int x = -9; int z = 10; for (int i = 1; i <= 10; i++) { if(i % 2 == 1) { x += 10; for(;x <= z;) { sum += x; x++; } cout << sum << ", "; totalSum += sum; sum = 0; z += 20; } } cout << "= " << totalSum << endl; return 0; }
 
ito na yung code. pasensya natagalan sa cp ko kasi ginawa. run mo ito ikaw na bahala sa disenyo. spoonfed ko na nga. ikaw na bahala diyan.

#include <iostream> using namespace std; int main() { int sum = 0; int totalSum = 0; int x = -9; int z = 10; for (int i = 1; i <= 10; i++) { if(i % 2 == 1) { x += 10; for(;x <= z;) { sum += x; x++; } cout << sum << ", "; totalSum += sum; sum = 0; z += 20; } } cout << "= " << totalSum << endl; return 0; }
ang tindi mo paps hahaha
 
ito na yung code. pasensya natagalan sa cp ko kasi ginawa. run mo ito ikaw na bahala sa disenyo. spoonfed ko na nga. ikaw na bahala diyan.

#include <iostream> using namespace std; int main() { int sum = 0; int totalSum = 0; int x = -9; int z = 10; for (int i = 1; i <= 10; i++) { if(i % 2 == 1) { x += 10; for(;x <= z;) { sum += x; x++; } cout << sum << ", "; totalSum += sum; sum = 0; z += 20; } } cout << "= " << totalSum << endl; return 0; }
Ayun! salamat po sa pag code. Ang hirap intindihin hahahaha.. Pag aralan ko nalang mabute po ung code nyo para mapaliwanag ng maayos sa proof hahaha..
 
Status
Not open for further replies.

About this Thread

  • 15
    Replies
  • 924
    Views
  • 5
    Participants
Last reply from:
Arcturus

Trending Topics

Online now

Members online
482
Guests online
3,774
Total visitors
4,256

Forum statistics

Threads
2,353,192
Posts
29,378,552
Members
1,082,891
Latest member
laris1702
Back
Top