Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Conver it from C Language to COBOL: #include #include int main { int i,sum = 0; printf(Sum = ); // displays Sum = for(i=10;i

Conver it from C Language to COBOL:

#include

#include

int main

{

int i,sum = 0;

printf("Sum = "); // displays Sum =

for(i=10;i<=30;i=i+2) // starting from 10 i increases in steps of 2 (even numbers) till it is equal to 30

{

if(i<30)

printf("%d+",i); // displays even numbers as 10+12+14+....

else

printf("%d",i); // as there should not be + after 30

sum = sum + i; //adds current i value to sum already present,initially sum is 0 then it becomes 10 then 22 so on

}

printf(" Sum = %d",sum); //prints the final value of sum

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

2. How much time should be allocated to the focus group?

Answered: 1 week ago