From 3b689b56607e646b2c064165f15bb4c059f59fec Mon Sep 17 00:00:00 2001 From: divyanshubisht <57855321+divyanshubisht@users.noreply.github.com> Date: Thu, 22 Oct 2020 12:25:40 +0530 Subject: [PATCH 1/3] added my name --- Hello world | 1 + 1 file changed, 1 insertion(+) diff --git a/Hello world b/Hello world index 3b7617c..0b313fd 100644 --- a/Hello world +++ b/Hello world @@ -2,5 +2,6 @@ int main() { printf("Hello, World!"); + printf("This is Divyanshu"); return 0; } From 933491b7716a55bfdef34149e61e4bae06127986 Mon Sep 17 00:00:00 2001 From: divyanshubisht <57855321+divyanshubisht@users.noreply.github.com> Date: Thu, 22 Oct 2020 12:36:31 +0530 Subject: [PATCH 2/3] updated the program --- pgm to read a line | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pgm to read a line b/pgm to read a line index 174d15b..0cd3bbd 100644 --- a/pgm to read a line +++ b/pgm to read a line @@ -2,17 +2,17 @@ #include int main() { - char c[1000] + char c[1000]; FILE *fptr; if ((fptr = fopen("program.txt", "r")) == NULL) { - print("Error! opening file") - exit(1) + printf("Error! opening file"); + exit(1); } scanf(fptr,"%[^\n]", c); printf("Data from the file:\n%s", c); - close(fptr) + close(fptr); return 0; } From 70986058ccc25d0cb91e78aeef7113932ce2bce5 Mon Sep 17 00:00:00 2001 From: divyanshubisht <57855321+divyanshubisht@users.noreply.github.com> Date: Thu, 22 Oct 2020 12:38:02 +0530 Subject: [PATCH 3/3] Update pgm to read a line --- pgm to read a line | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgm to read a line b/pgm to read a line index 0cd3bbd..0f4bffd 100644 --- a/pgm to read a line +++ b/pgm to read a line @@ -11,7 +11,7 @@ int main() } scanf(fptr,"%[^\n]", c); - printf("Data from the file:\n%s", c); + printf("Data from the file :\n%s", c); close(fptr); return 0;