🔒 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.

Similar threads

About this Thread

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

Trending Topics

Online now

Members online
1,217
Guests online
3,319
Total visitors
4,536

Forum statistics

Threads
2,305,797
Posts
29,167,895
Members
1,195,454
Latest member
goodman777
Back
Top