From 1d7cf3cff77891f28625ebb0db459acd608c6964 Mon Sep 17 00:00:00 2001 From: Anupama-74 <64727920+Anupama-74@users.noreply.github.com> Date: Mon, 19 Oct 2020 19:27:55 +0530 Subject: [PATCH 1/4] Update Hello world --- Hello world | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Hello world b/Hello world index 3b7617c..b7da9e7 100644 --- a/Hello world +++ b/Hello world @@ -1,6 +1,2 @@ -#include -int main() -{ - printf("Hello, World!"); - return 0; -} +#to print the "Hello World in python language +print("Hello, World!!") From 8e654375b0c95ad26ee728498e2066f8e334915c Mon Sep 17 00:00:00 2001 From: Anupama-74 <64727920+Anupama-74@users.noreply.github.com> Date: Mon, 19 Oct 2020 19:35:34 +0530 Subject: [PATCH 2/4] Update frequency of a character --- frequency of a character | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frequency of a character b/frequency of a character index b5334ac..f29b638 100644 --- a/frequency of a character +++ b/frequency of a character @@ -2,15 +2,15 @@ int main() { char str[1000], ch int i, frequency = 0 - print("Enter a string: "); + print("Enter the string in which you want to find the character frequency: "); gets(str); - printf("Enter a character to find the frequency: "); + printf("Enter a character to find the frequency in the given string: "); scanf("%c",&ch); for(i = 0; str[i] != '\0'; ++i) { if(ch == str[i]) ++frequency; } - printf("Frequency of %c = %d", ch, frequency); + printf("Frequency of %c = %d in the string provided", ch, frequency); return 0; } From faeef2a88f84761187fcf4ef0e06ae5077b5b25e Mon Sep 17 00:00:00 2001 From: Anupama-74 <64727920+Anupama-74@users.noreply.github.com> Date: Mon, 19 Oct 2020 19:37:47 +0530 Subject: [PATCH 3/4] Update length of a string --- length of a string | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/length of a string b/length of a string index 33cd513..3dd2b68 100644 --- a/length of a string +++ b/length of a string @@ -3,9 +3,9 @@ int main() { char s[1000]; int i; - print("Enter a string: ") + print("Enter a string for which you need to find the length: ") scan("%s", s) for(i = 0; s[i] != '\0'; ++i) - printf("Length of string: %d", i); + printf("Length of the provided string: %d", i); } From 192fc31fb0940b618636e351eed67f98e911b5ac Mon Sep 17 00:00:00 2001 From: Anupama-74 <64727920+Anupama-74@users.noreply.github.com> Date: Mon, 19 Oct 2020 19:41:24 +0530 Subject: [PATCH 4/4] Update pgm to read a line --- pgm to read a line | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pgm to read a line b/pgm to read a line index 174d15b..27f43e6 100644 --- a/pgm to read a line +++ b/pgm to read a line @@ -1,17 +1,18 @@ #include -#include +#include //for exit() int main() { - char c[1000] + char ch[1000] FILE *fptr; if ((fptr = fopen("program.txt", "r")) == NULL) { - print("Error! opening file") + print("Error! opening file") // program exits if file pointer returns NULL exit(1) } - scanf(fptr,"%[^\n]", c); - printf("Data from the file:\n%s", c); + // reads text untill newline is encountered + scanf(fptr,"%[^\n]", ch); + printf("Data from the file:\n%s", ch); close(fptr) return 0;