Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing the simple code for step 3. The code in step two (in the box) is all of what I have written

I need help writing the simple code for step 3. The code in step two (in the box) is all of what I have written so far. image text in transcribed

2. Add declarations for variables of types char, unsigned int, long and float Test the following using the simulator, debug and watch variables #include #pragma config WDT = OFF int i = 10; Within the main, but above the loop assign values to the variables (what happens if no value is assigned to a variable) char c; unsigned int j; long int x; Write lines of code to assign a range of values to variables - to test how big a value it can hold, what about +ve and -ve values? (what value show in variable watched during debugging) float f. void main(void) Write lines of code that do some basic mathematics +, -, *, / using variables (which operations might cause problems achieving the intended result?) { f= 1.2345; Try assigning the value of one variable type to another type, (what limitations might occur?) 1000000; f=f*i; Try a range of different combinations of variables (can you think of problems that might be caused by such operations) // add more here while(1) { } There is no need to have any code in the while(1) loop, but to rerun the program for testing you have to press Reset in the debug buttons. Alternately you could place all your code within the endless loop. } 3. Create a loop within your main program's endless loop which counts to 10 and adds up those counts. le. Start with i as 1, sum as 0, count from 1 to 10, sum = sum + i; Include an IF statement to test the count value and skip 6 Try a range of different tests

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions