How do you write a program to scan a number n and then output the sum of the powers from 1 to n using for loop statement?

1 answer

Answer

1003629

2026-05-14 04:10

+ Follow

#includ<iOStream.h>

int main ()

{

int n,n-1;

for(n=0);

cout<<"the number is even:"<<endl;

if(n=n-1)

cout<<"the number is prime:"<<endl;

getch 0;

return 0;

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.