I have just started C programming after a semester of Java. I am very new to this and the teacher has not really given much instruction so I am completely lost on what to do for this. I need to determine the decimal value f the following constants: 034, 0xA, 0xBA, and 12.3xE+3 and write a simple program to verify my calculations.

I am using emacs as my IDE and gcc as my compiler I think? I am so lost please help

I can understand that starting a new programming language can be challenging, especially without clear instructions. Don't worry, I'm here to help!

To determine the decimal value of the given constants in C, we need to understand the different number formats used in the language. Here's a breakdown of each constant:

1. 034: This constant starts with a leading zero, which indicates an octal (base-8) number. To convert it to decimal, you can simply treat it as an octal number and find its decimal value.

2. 0xA: This constant starts with "0x," which indicates a hexadecimal (base-16) number. Hexadecimal numbers use the digits 0-9 and the letters A-F to represent values 0-15. To convert it to decimal, you can treat it as a hexadecimal number and find its decimal value.

3. 0xBA: Similar to the previous constant, 0xBA is a hexadecimal number. Convert it to decimal using the same process as explained above.

4. 12.3xE+3: This constant represents a floating-point number expressed in scientific notation. The "E" part indicates the exponent. To calculate the decimal value, you need to multiply the significand (12.3) by 10 raised to the power of the exponent (+3 in this case).

To write a simple program to verify these calculations in C, you can use the following code:

```c
#include <stdio.h>

int main() {
int constant1 = 034;
int constant2 = 0xA;
int constant3 = 0xBA;
float constant4 = 12.3E+3;

printf("Decimal values:\n");
printf("Constant 1: %d\n", constant1);
printf("Constant 2: %d\n", constant2);
printf("Constant 3: %d\n", constant3);
printf("Constant 4: %.2f\n", constant4);

return 0;
}
```

In this program, we declare four variables (`constant1`, `constant2`, `constant3`, and `constant4`) and assign the values of the given constants. Then we use the `printf` function to print the decimal values of these constants. The format specifier `%d` is used for integers, and `%f` is used for floating-point numbers. The `.2` before `f` in `%.2f` represents the precision (decimal places) to be displayed.

To compile the program using gcc in emacs, follow these steps:

1. Save the program with a .c extension (e.g., `decimal_values.c`).

2. Open the terminal.

3. Navigate to the directory where you saved the program using the `cd` command.

4. Compile the program using the following command:

```
gcc -o decimal_values decimal_values.c
```

This command will generate an executable file named `decimal_values`.

5. Run the program by executing the following command:

```
./decimal_values
```

You should see the decimal values of the constants printed on the terminal.

By following these instructions, you should be able to determine the decimal values of the given constants and verify them using the provided program.