Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scrolling Output That Exceeds Screen Size
#17
Example for Tim in C.

As an example, I wrote the program with the formatted output in "C", the vertical output is difficult in "C" because it doesn't know Locate

Code: (Select All)

//Formatierte Ausgabe, Basic Programm - 10. April 2024

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int eingabe;

system("cls");
printf("\nThis program will count to 100 from the number you supply.");
printf("\nEnter the number to start counting from > ");
scanf("%d", &eingabe);
printf("\n");

for(int i = eingabe; i <= 100; i++)
{
printf("%4d", i);
if((i % 20) == 0)
printf("\n");
}
return(0);
}

[Image: C-Formatierte-Ausgabe2024-04-10.jpg]

If you want to try it yourself:
1. Download and install MinGW; latest 13.2.0
MinGW 13

2. Get editor:
Notepad

3. Compile (File: formatierte-ausgabe.c)
gcc -o formatierte-ausgabe formatierte-ausgabe.c

4. If everything works, enter in Powershell: ./formatierte-ausgabe
(the "./" is not necessary in the command line)

The world belongs to the brave! (Or so  Tongue )
Reply


Messages In This Thread
RE: Scrolling Output That Exceeds Screen Size - by Kernelpanic - 04-10-2024, 04:43 PM



Users browsing this thread: 1 Guest(s)