Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
22
Task/User-input-Text/C/user-input-text-1.c
Normal file
22
Task/User-input-Text/C/user-input-text-1.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// Get a string from stdin
|
||||
char str[BUFSIZ];
|
||||
puts("Enter a string: ");
|
||||
fgets(str, sizeof(str), stdin);
|
||||
|
||||
// Get 75000 from stdin
|
||||
long num;
|
||||
char buf[BUFSIZ];
|
||||
do
|
||||
{
|
||||
puts("Enter 75000: ");
|
||||
fgets(buf, sizeof(buf), stdin);
|
||||
num = strtol(buf, NULL, 10);
|
||||
} while (num != 75000);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue