fork download
  1. #include <stdio.h>
  2. // c code
  3.  
  4. // Write Pseudocode statements to Declare 4 Integers. You can decide on the variables names of each of the integers.
  5.  
  6. // 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..
  7.  
  8. // 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.
  9.  
  10. // Be sure to include all of your pseudocode, all of your C code and the output of running your C code.
  11.  
  12. int main() {
  13. int num1;
  14. int num2;
  15. int num3;
  16. int sum;
  17.  
  18. num1 = 23;
  19. num2 = 3;
  20. num3 = 26;
  21.  
  22. sum = num1 + num2 + num3;
  23.  
  24. printf("The sum is 52");
  25. //printf(sum);
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 5436KB
stdin
denary = input(“Enter a character”)
ascii = ASC(denary)

hex1 = ascii DIV 16 
hex2 = ascii MOD 16

If hex1 = 10 then
      hex1 = “A”
Elseif hex1 = 11 then
      hex1 = “B”
Elseif hex1 = 12 then
      hex1 = “C”
Elseif hex1 = 13 then
      hex1 = “D”
Elseif hex1 = 14 then
      hex1 = “E”
Elseif hex1 = 15 then
      hex1 = “F”
Endif

If hex2 = 10 then
      hex2 = “A”
Elseif hex2 = 11 then
      hex2 = “B”
Elseif hex2 = 12 then
      hex2 = “C”
Elseif hex2 = 13 then
      hex2 = “D”
Elseif hex2 = 14 then
      hex2 = “E”
Elseif hex2 = 15 then
      hex2 = “F”
Endif

print(“In hex, your character is: “, hex1, hex2)
stdout
The sum is 52