matt wrote:

> I new to programming and have started with c. I am stuck on 2 questions

> and cannot move forward, any help would be greatly appreciated.

>

> Question 1: Express each number as a floating-point constant using both

> regular decimal notation and exponential notation.

> a) 1,234

> b) 1,234.5

> c) 0.1234

> d) 1.234 x 10 to the second power

>

> Question 2: Express each number as an integer constant, an octal

> constant, and a hexadecimal constant.

> a) 1,234

> b) 2

> c) 8

> d) 16

> e) 1,024
#include <stdio.h>

inline void Q1(double x)

{

printf("fixed: %f; exponential: %e\n", x, x);

}

inline void Q2(unsigned x)

{

printf("decimal: %d; octal: %#o; hex: %#x\n", x, x, x);

}

int main(void)

{

Q1(1234);

Q1(1234.5);

Q1(0.1234);

Q1(1.234e2);

Q2(1234);

Q2(2);

Q2(

;

Q2(16);

Q2(1024);

return 0;

}

fixed: 1234.000000; exponential: 1.234000e+03

fixed: 1234.500000; exponential: 1.234500e+03

fixed: 0.123400; exponential: 1.234000e-01

fixed: 123.400000; exponential: 1.234000e+02

decimal: 1234; octal: 02322; hex: 0x4d2

decimal: 2; octal: 02; hex: 0x2

decimal: 8; octal: 010; hex: 0x8

decimal: 16; octal: 020; hex: 0x10

decimal: 1024; octal: 02000; hex: 0x400

> Thanks in advance.
Save your bill collector cant for your job as a bill collector. Bite me.