Answer:
The answer is weak, Have a nice day! :)
Explanation:
D) weak
Void test(char *s)
{
int i, d;
sscanf(s, "%i", &i);
printf("%s converts to %i using %%i\n", s, i);
sscanf(s, "%d", &d);
printf("%s converts to %d using %%d\n", s, d);
}
int main()
{
test("123");
test("0x123");
return 0;
}
outputs:
123 converts to 123 using %i
123 converts to 123 using %d
0x123 converts to 291 using %i
0x123 converts to 0 using %d
As you can see, %i is capable of parsing hexadecimal, whereas %d is not. For printf they're the same.
Answer:
The program in Python is as follows:
n = int(input("Integer: "))
product = 1
for i in range(1,n+1):
product*=i
if(i!=n):
print(str(i)+" *",end =" ")
else:
print(i,end =" ")
print(" = ",product)
Explanation:
This prompts the user for integer input
n = int(input("Integer: "))
This initializes the product to 1
product = 1
This iterates through n
for i in range(1,n+1):
This multiplies each digit from 1 to n
product*=i
This generates the output string
<em> if(i!=n):</em>
<em> print(str(i)+" *",end =" ")</em>
<em> else:</em>
<em> print(i,end =" ")</em>
This prints the calculated product (i.e. factorial)
print(" = ",product)
Answer:
I think you have to ask you're teacher, not brainly because people on here can't answer this for you