Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commenting #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions 03-for_loop.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include<stdio.h>
#include<stdlib.h>
#include<stdio.h> // stdio Header file
#include<stdlib.h> // stdlib Header file

int main() {

printf("Hello World\n");
int i;
for(i=0; i<10; i++)
printf("Hello World\n"); // print simple Hello msg
int i; // i is initialized to 1
for(i=0; i<10; i++) // for( initial value ; end condition ; increment of i )
{
printf("In a loop\n");
printf("In a loop\n"); // Printing msg which show's when loop executing 10 times
}

return EXIT_SUCCESS;
Expand Down
12 changes: 6 additions & 6 deletions 09-getchar_example.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include<stdio.h>
#include<stdlib.h>
#include<stdio.h> // stdio Header file
#include<stdlib.h> // stdio Header file

int main()
{
printf("Please enter a char \n");
char c = getchar();
getchar(); // for the newline
printf("Please enter a char \n"); // Asking user to enter a character
char c = getchar(); // getting user character input in c variable
getchar(); // for the newline

printf("The user entered %c, what a character \n",c);
printf("The user entered %c, what a character \n",c); // showing output to user that user enter this character

return 0;

Expand Down