write an algorithm and draw a flowchart to calculate the sum of of the first 10 natural numbers starting from 1​

Answers

Answer 1

Answer:

#include <stdio.h>

void main()

{

int j, sum = 0;

printf("The first 10 natural number is :\n");

for (j = 1; j <= 10; j++)

{

sum = sum + j;

printf("%d ",j);

}

printf("\nThe Sum is : %d\n", sum);

}

Within a loop

Step 1: Initialize a variable to 1 (say x=1)

Step 2: Specifiy the condition

In this case x<=10

Step 3: Increment the variable by 1

using increment operator x++

OR

simply x+=1(x=x+1)

Step 4: Print the value of variable

Terminate the loop

Explanation:


Related Questions


What is the total March Expenditure now? (cell Q2)

Answers

I did a lot to do it lol was

#include
main()
{
int i, n=10, rem, inc=0;
scanf("%d",&n);
for(i=1; i =3)
inc++;
else;
inc--;
}
printf("Final Value=\n",inc);
}
SOLVE THIS PROGRAM...

Answers

Answer:inpossible !889

Explanation: I npossible !889

Other Questions
The odometer of a car reads 57321 km when the clock shows the time 8.30 am. What is the distance moved by the car, if at 8.50 am, the odometer reading has changed to 57336.0 km? Calculate the speed of the car in km/min during this time. Can someone at least make jot notes of this question Im not looking for detail or anything thanks Which activity could you do to improve muscular strength?Going on a 10 mile bike rideChoosing a Vegan dietRunning a marathonDoing a vertical jump or dynamic push upAnswererr What is the equation of the linear function represented by the table?O y=-X+9O y=-x+ 13O y=x+13O Y = X+9 Identify the percent of change as an increase or decrease. Then find the percent ofchange. Round to the nearest tenth of a percent, if necessary.$18.75 to $18.60Answers:Increase; 15%Decrease; 0.15%Decrease: 0.008%Decrease; 0.8% What is moral duty?Please tell me the answer of this question. The eye color of children often resembles the eye color of their parents. Which of the following is genetically passed from parents to children?A. Particles of color are passed from parents to children.B. Cells that become the colored part of the eye are passed from parents to children.C. Nothing having anything to do with eye color is passed from parents to children.D. Molecules (DNA) that contain the information that determines eye color are passed from parents to children. in the story if on common lit which statement best describes the main theme of the poem Miles bought a new pair of baseball cleats for $64.95. The sales tax is 6.5%. What is the total cost that Miles will pay? Find the value of x. Round your answer to the nearest tenth. What is the purpose of DNA? bkt magkakaiba layunin ng kanilang gingwa ang mga may buhay na nilikha ng diyos The tangible assets of an organization includeA. Company reputation B. Patents C. Real estate D. Technical knowledge Please answer! I will mark Brainlist! When something is plumb, it isA. horizontally levelB. bobbedC. exactly verticalD. at a 30-degree angle I. find the distance the two given points HELPPP PLSSSS I REALLY NEED HELP!!! Calculate the quotient.A. 3/4 divided by 5 1/5 is? B. 3/7 divided by 2 1/2 is? C. 5/8 divided by 6 5/6 is? D. 8 3/10 divided by 5/8 is? How are text boxes important and why should we never skip over them? how has personal finance literacy affect you in your daily life?