• This project
    • Loading...
  • Sign in

kykint / OSS_Experiments04_Assignment2

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • OSS_Experiments04_Assignment2
  • echo.c
  • kykint's avatar
    Exit on input 'exit' · 2a0c888a
    2a0c888a
    kykint authored 2019-03-29 11:36:40 +0900
echo.c 279 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <stdio.h>
#include <string.h>

int main(void) {
	printf("Input a string\n");
	printf("Will exit on input \"exit\"\n");

	while (1) {
		char str[50];
		scanf("%s", str);
		if (strcmp(str, "exit") == 0) {
			break;
		} else {
			printf("%s\n", str);
		}
	}

	return 0;
}