+ 1
Can any one give me any idea for the FLOWCHART of the following code ????
#include <iostream> using namespace std; int main() { int sum=0; int i=1; do{ cout<<i<<endl; sum+=i; i++; } while(i<=10); cout<<"sum is"<<sum; return 0; }
1 Answer
+ 2
flow chart? Im assuming you don't know what a do while loop does and so I will explain that
do{
//performs the code in here atleast once
}
while(if condition in here is true repeat the do part again)
main difference between this and a while loop is that this will always execute the code within atleast once