Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Courses
csci206_lecture_examples
Commits
fe61bee4
Commit
fe61bee4
authored
Jan 14, 2014
by
Alan Marchiori
Browse files
added a few and minor syntax changes
parent
94317caf
Changes
7
Hide whitespace changes
Inline
Side-by-side
Lec1/.gitignore
0 → 100644
View file @
fe61bee4
*~
*.out
Lec1/array.c
0 → 100644
View file @
fe61bee4
int
main
(
void
)
{
double
y
[
10
];
double
x
;
y
[
0
]
=
3
.
1415926
;
y
[
1
]
=
2
.
71828
;
y
[
2
]
=
0
;
y
[
10
]
=
666
;
}
Lec1/eighth.c
View file @
fe61bee4
...
...
@@ -9,6 +9,6 @@ int main(int argc, char* argv[]) {
printf
(
"pi= %f
\n\n
"
,
pi
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
printf
(
"pf[%d]= %x
\n
"
,
i
,
pf
[
i
]);
printf
(
"pf[%d]= %
02hh
x
\n
"
,
i
,
pf
[
i
]);
}
}
Lec1/first.c
View file @
fe61bee4
#include
<stdio.h>
#include
<stdlib.h>
int
main
(
int
argc
,
char
*
argv
[])
{
printf
(
"hello C world
\n
"
);
int
main
(
int
argc
,
char
*
argv
[])
{
printf
(
"hello C world
\n
"
);
// from stdio.h
return
EXIT_SUCCESS
;
// from stdlib.h
}
Lec1/scanf.c
0 → 100644
View file @
fe61bee4
#include
<stdio.h>
int
main
(
void
){
int
i
;
float
x
;
char
text
[
80
];
scanf
(
"%d"
,
&
i
);
scanf
(
"%f"
,
&
x
);
scanf
(
"%s"
,
text
);
printf
(
" i= %d
\n
"
,
i
);
printf
(
" x= %f
\n
"
,
x
);
printf
(
" text= %s
\n
"
,
text
);
}
Lec1/selection.c
0 → 100644
View file @
fe61bee4
switch
(
i
)
{
case
1
:
j
=
-
i
;
break
;
case
2
:
j
+=
123
;
break
;
case
3
:
j
=
999
;
break
;
default:
{
j
=
666
;
}
break
;
}
Lec1/sixth.c
View file @
fe61bee4
...
...
@@ -5,8 +5,8 @@ int main(int argc, char* argv[]) {
int
i
=
7
;
int
j
=
-
1
;
int
*
pi
=
&
i
;
int
*
pj
=
&
j
;
int
*
pi
=
&
i
;
int
*
pj
=
&
j
;
printf
(
" i = %d
\n
"
,
i
);
printf
(
" j = %d
\n
"
,
j
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment