Question: 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. I need help writing the simple code for step 3. The code

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!