0

visual studio 2019, C17

I can't figure out how to get the output as in the example with different input data.

example 1 expected output:
1234     1234
 123      123

example 2 expected output:
1234568912     1234568912
     23456          23456

My code:

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main() {
double num1, num2, num3, num4;
   printf("Enter numbers: ");
   scanf("%lf", &num1);
   scanf("%lf", &num2);
   scanf("%lf", &num3);
   scanf("%lf", &num4);
   printf("%*.lf %*10.lf\n", 20, num1, 20, num2);
   printf("%*.lf %*10.lf\n", 20, num3, 20, num4);

   return 0;
} 
Moon
  • 1
  • 2
  • 1
    Please do not post text output as images - [reasoning](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question). Copy it as formatted text into the question. – kaylum May 27 '21 at 22:08
  • When you compile the code, the warnings should be displayed in a `build` pane at the bottom of the IDE's window. Be sure to check for and fix all warnings. If you aren't seeing any warnings, increase the warning level, at least to `/W3`, but for simple programs like this you should be able to use `/W4` – user3386109 May 28 '21 at 21:00

0 Answers0