Add files via upload

This commit is contained in:
Venky-234 2023-12-21 21:54:02 +05:30 committed by GitHub
parent 11663e4c20
commit fd60ec2ab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 0 deletions

16
tutorial1.c Normal file
View File

@ -0,0 +1,16 @@
// tutorial 1 : simple hello world
// write comments like this
/*
or you could write comments like this too
*/
#include<stdio.h>
int main(){
printf("hello world\n");
printf("byee world\n");
// "\n" is a newline character
return 0;
}
// HAPPY CODING !!!

37
tutorial2.c Normal file
View File

@ -0,0 +1,37 @@
// tutorial 2 : vaiables
#include<stdio.h>
// you can create vaiables this way
// global variables can be accessed thourught the entire program
int i = 12;
float pi = 3.14;
char a = 'g';
//
int main(){
/* local variables can be used only
within the scope in which they are defined in
*/
int local_variable = 34;
char alphabet = 'g';
printf("local vaiables : \n");
printf("%d, %c",local_variable, alphabet); // you can print vaibles this way
printf("global vaiables : \n");
printf("%d, %f, %c",i, pi, a); // you can print vaibles this way
/*
%d is for integers
%f is for float
%d is for double
%c is for char
%s is for string
*/
/*
char takes one byte
integers takes 4 bytes
float takes up 4 bytes
*/
return 0;
}
// HAPPY CODING !!!!