Seems like a trivial question, but I can seem to figure it out. How to make 2 outputs a certain distance appart regardless of size of first input?
For example this is my current output:
Dell $1200
Toshiba $2000
Sony Vaio $1000
The spaces are uneven when I print them out. I want the output to look like the following:
Dell $1200
Toshiba $2000
Sony Vaio $1000
Basically I want the distance to be the same between the 2 outputs regardless of the size of the first input.
This is my code:
printf("\nEnter a laptops name: ");
scanf("%s", &laptopName);
printf("Enter its price: ");
scanf("%d", &laptopPrice);
printf("\n");
printf("%s ", laptopName);
printf("$%d", laptopPrice);