Binaries; Age; Age2; Age3; Average Grade; Calculator; first-program; Full Name, Age, and Gender; Rectangle; Traingle; Triangle2; User Input; User Input2; Variables; Year
This commit is contained in:
parent
75ce99c7ef
commit
4c91ebba87
29 changed files with 165 additions and 0 deletions
8
Age.c
Normal file
8
Age.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("I am %d years old\n", 21);
|
||||
return 0;
|
||||
}
|
8
Age2.c
Normal file
8
Age2.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("I am %d years old \nHe is %d years old\n", 21, 22);
|
||||
return 0;
|
||||
}
|
8
Age3.c
Normal file
8
Age3.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("I am %d years old \nHe is %d years old\n", 21);
|
||||
return 0;
|
||||
}
|
8
Average Grade.c
Normal file
8
Average Grade.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Average grade: %1f\n", 93.7);
|
||||
return 0;
|
||||
}
|
BIN
Binaries/Age
Executable file
BIN
Binaries/Age
Executable file
Binary file not shown.
BIN
Binaries/Age2
Executable file
BIN
Binaries/Age2
Executable file
Binary file not shown.
BIN
Binaries/Age3
Executable file
BIN
Binaries/Age3
Executable file
Binary file not shown.
BIN
Binaries/Average Grade
Executable file
BIN
Binaries/Average Grade
Executable file
Binary file not shown.
BIN
Binaries/Caulculator
Executable file
BIN
Binaries/Caulculator
Executable file
Binary file not shown.
BIN
Binaries/Full Name, Age, and Gender
Executable file
BIN
Binaries/Full Name, Age, and Gender
Executable file
Binary file not shown.
BIN
Binaries/Rectangle
Executable file
BIN
Binaries/Rectangle
Executable file
Binary file not shown.
BIN
Binaries/Triangle
Executable file
BIN
Binaries/Triangle
Executable file
Binary file not shown.
BIN
Binaries/Triangle2
Executable file
BIN
Binaries/Triangle2
Executable file
Binary file not shown.
BIN
Binaries/User Input
Executable file
BIN
Binaries/User Input
Executable file
Binary file not shown.
BIN
Binaries/User Input2
Executable file
BIN
Binaries/User Input2
Executable file
Binary file not shown.
BIN
Binaries/Variables
Executable file
BIN
Binaries/Variables
Executable file
Binary file not shown.
BIN
Binaries/Year
Executable file
BIN
Binaries/Year
Executable file
Binary file not shown.
BIN
Binaries/first-and-last-name
Executable file
BIN
Binaries/first-and-last-name
Executable file
Binary file not shown.
BIN
Binaries/first-program
Executable file
BIN
Binaries/first-program
Executable file
Binary file not shown.
11
Caulculator.c
Normal file
11
Caulculator.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("%d + %d = %d\n", 5, 2, 5+2);
|
||||
printf("%d - %d = %d\n", 5, 2, 5-2);
|
||||
printf("%d * %d = %d\n", 5, 2, 5*2);
|
||||
printf("%d / %d = %d + %d / 2 \n", 5, 2, 5/2, 5 % 2);
|
||||
return 0;
|
||||
}
|
7
Full Name, Age, and Gender.c
Normal file
7
Full Name, Age, and Gender.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Full name: Henry Olson \nAge: 15 \nGender: Male\n");
|
||||
return 0;
|
||||
}
|
20
Rectangle.c
Normal file
20
Rectangle.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
float l, w; /* Length and Width */
|
||||
|
||||
printf("Rectangle Area\n");
|
||||
|
||||
printf("Length: ");
|
||||
scanf("%f", &l);
|
||||
|
||||
printf("width: ");
|
||||
scanf("%f", &w);
|
||||
|
||||
printf("Area: %f\n", l*w); /* Area = length x width */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
20
Triangle.c
Normal file
20
Triangle.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf(" /\\\n");
|
||||
printf(" / \\\n");
|
||||
printf(" / \\\n");
|
||||
printf(" / \\\n");
|
||||
printf(" / \\\n");
|
||||
printf("/__________\\\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* /\
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/__________\ */
|
14
Triangle2.c
Normal file
14
Triangle2.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf(" /\\\n / \\\n / \\\n / \\\n / \\\n/__________\\\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* /\
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/__________\ */
|
9
User Input.c
Normal file
9
User Input.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
char myString[100];
|
||||
scanf("%s", &myString);
|
||||
printf("%s\n", &myString);
|
||||
return 0;
|
||||
}
|
10
User Input2.c
Normal file
10
User Input2.c
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
char myString[100];
|
||||
printf("Message: ");
|
||||
fgets(myString, sizeof(myString), stdin);
|
||||
printf("%s\n", myString);
|
||||
return 0;
|
||||
}
|
12
Variables.c
Normal file
12
Variables.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
int num;
|
||||
printf("What is num: ");
|
||||
scanf("%d", &num);
|
||||
printf("num is %d\n", num);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
20
Year.c
Normal file
20
Year.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
int yr; /* Year */
|
||||
int byr; /* Birth Year */
|
||||
|
||||
printf("What is the current year: ");
|
||||
scanf("%d", &yr);
|
||||
|
||||
printf("What is your year of birth: ");
|
||||
scanf("%d", &byr);
|
||||
|
||||
printf("Current year: %d\n", yr);
|
||||
printf("Your year of birth %d\n", byr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
10
first-program.c
Normal file
10
first-program.c
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Henry Olson\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue