Skip to content
Merged
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: 12 additions & 0 deletions Workshop/Day 0/codes/five.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
int main(){
int num = 100;
int toggle;
//&& is a boolean and operator that is true if both of the conditions are true
if(num > 5 && num < 15)
toggle =1;
else
toggle =0;

return 0;
}

11 changes: 11 additions & 0 deletions Workshop/Day 0/codes/four.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
int main(){
int birthYear, age;
int drinkingAge;
birthYear = 2015;
age = 2021 - birthYear;
if (age <= 18)
drinkingAge = 0;
else
drinkingAge = 1;
return 0;
}
11 changes: 11 additions & 0 deletions Workshop/Day 0/codes/one.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

int main()
{
int a=5, c=2;
float d;
a = 8;
d = 2.5;
float b = 'a'/2.5f;
char z = 'A' + 32;
return 0;
}
14 changes: 14 additions & 0 deletions Workshop/Day 0/codes/six.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
int main(){
int hisNumber = 4000;
int toggle;
//first condition
if (hisNumber>500 && hisNumber<5000){
//second condition
if (hisNumber%177==0){
toggle = 1;
}
}
else
toggle = 0;
return 0;
}
11 changes: 11 additions & 0 deletions Workshop/Day 0/codes/three.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
int main(){
int aInt = 1;
float bFloat = 2.5f;

int cMul = aInt * bFloat;
float dMul = aInt * bFloat;
float cDiv = aInt / bFloat;
int div = aInt / bFloat;

return 0;
}
13 changes: 13 additions & 0 deletions Workshop/Day 0/codes/two.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
int main(){
//These are comments int main()
/*ksj These
dhfoid Are
fkjasdg Multi Line
fhsadklComments
jfhlkasdf*/

//int int = 76; (doesnt work because int is a keyword hence cannot be a variable name)
int rollNo = 76;

return 0;
}
20 changes: 20 additions & 0 deletions Workshop/Day 0/codes/twopointfive.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
int main(){
int num1, num2, sum;
float pointnumber;
char firstChar;
int sizeofInt, sizeofChar, sizeofFloat;

num1=5;
num2=10;
sum = num1 + num2;
pointnumber = 2.5;
firstChar = 'A';
sizeofInt = sizeof(sum);
sizeofChar = sizeof(firstChar);
sizeofFloat = sizeof(2.5f);




return 0;
}
Binary file added Workshop/Day 0/day0.pdf
Binary file not shown.