project-team-f created by GitHub Classroom
We will work according to the document tasks.md (just in case you don’t know!).
Our team will set up this document (README.md), and include some data in it. We will also create a project board, with Basic Kanban template, and set up automations to it. A code written in C will be created and also included in this document. Finally, we will promote our team’s page!
# include <stdio.h>
# include <string.h>
void fun(){
printf("HI! This is a simple function!\n");
}
int main(){
printf("------------------------------------------------\n");
printf("-----------Simple Demonstration of C------------\n");
printf("------------------------------------------------\n");
printf("Hello World!\n"); //Hello World
int i;
for(i=0;i<10;i++) //Simple for loop
{
printf("I am %d\n",i);
}
char name[] = "chuckjee"; //array
if(strcmp(name,"chuckjee")==0) // if...else
{
printf("YES, I am %s!\n",name);
}
else
{
printf("NO, I am not the one you want!\n");
}
fun(); // simple function
int a = 10;
int * p = &a; // pointer manipulation
printf("Value of variable a: %d\n", a);
printf("Address of a: %p\n", &a);
printf("Value of pointer p pointed to a: %p\n", p);
printf("Dereference of p pointed to a: %d\n",*p);
int flag;
printf("Enter a value (1-5): "); // Get user input
scanf("%d",&flag);
switch (flag) { // switch statements
case 1:
printf("1 is one.\n");
break;
case 2:
printf("2 is two.\n");
break;
case 3:
printf("3 is three.\n");
break;
case 4:
printf("4 is four.\n");
break;
case 5:
printf("5 is five.\n");
break;
default:
printf("Why didn't you input 1-5?");
}
return 0;
}
WU, Ka Meng @auuauuauuu
YIP, Kai Hin @Henryhin
HUNG, Yiu Pan @hungjack1998111
LI, Kam Po @ericlikp
WONG, Yik Lee @leowong1120
MAK, Chin Yung @tony1509
LI, Cheuk Ho @patrickli0326
CHIU, Lin Fung @RitoGamingPLZ
SAU, Long Hei @daniellcell
LAM, Hoi Kit @tonylam1211
CHAN, Wai Lap @wailap9
CHEUNG, Chi Hang Calvin @calvinc0630
CHEUNG, Chuen Choi @11Skywalker11
LEE, Tsz Hin @alexlee820
WONG, Tsz Chun @wongtc8
ZHAO, Feng @EFSEVEN
CHIN, Chun Kiu @1155110936
Last updated: 2019-04-24 00:15:46 +0800