Free Essay

Cmis Wk2 Hands on

In:

Submitted By BrandGSX
Words 256
Pages 2
Write Pseudocode statements to Declare 4 Integers. You can decide on the variables names of each of the integers.

Then, still using Pseudocode, set the values for 3 of the integers to valid integer values of your choice. In pseudocode, set the value of the 4th integer to the sum of the other 3 integers. Finally, print the output of the summed integers.

Next, take your pseudocode and convert it to C code and demonstrate it runs properly in an online C compiler such as ideone.com or codetwist.com.

Be sure to include all of your pseudocode, all of your C code and the output of running your C code.

//define integers

integers = a, b, c, d, e

//define integer values

a=2

b=4

c=6

d=a+b+c

e=d*2

printf ("text explaining the math for how the value of d is derived" display integer d)

printf ("send text explaining how the value of e is derived" display integer e)

printf ("whats on my mind")

C code

#include

int main(void) {
// declare integers int a, b, c, d, e;
// associate integers with values a = 2; b = 4; c = 6; d = a + b + c; e = d*2;
// define output printf("(2 + 4 + 6) = (a + b + c) = d = %d \n", d); printf("12 x 2 or d x 2 = %d \n", e); printf("Word to the wise. Don't take a programing \n"
"and a foreign language class at the same time. \n"
"I think I broke my brain this week!"); return 0;
}

Similar Documents