Commit 4bc3370d authored by Alan Marchiori's avatar Alan Marchiori
Browse files

created lec2

parent 12f883d4
#include <stdio.h>
int main(int argc, char* argv[]) {
int i, j;
j=0;
for (i=0; i<100; i++) {
j += i;
}
printf("i= %d, j= %d\n\n", i, j);
i=0; j=0;
while (i<100) {
j += i;
i++;
}
printf("i= %d, j= %d\n\n", i, j);
i=0; j=0;
do {
j += i;
i++;
} while (i<100);
printf("i= %d, j= %d\n\n", i, j);
}
#include <stdio.h>
int main(int argc, char* argv[]) {
{
int i = 999;
int j = 666;
printf("i= %d, j= %d\n", i, j);
{
int i = 123;
int j = i*i;
printf("i= %d, j= %d\n", i, j);
}
printf("i= %d, j= %d\n", i, j);
}
}
#include <stdio.h>
int i = 7;
float x = 2.71828;
double y = 3.1415926;
char c = 'w';
int main(int argc, char* argv[]) {
printf("%d, %c, %f, %lf\n", i, c, x, y);
}
#include <stdio.h>
int main(int argc, char* argv[]) {
int i = 7;
float x = 2.71828;
double y = 3.1415926;
char c = 'w';
printf("%d, %c, %f, %lf\n", i, c, x, y);
}
#include <stdio.h>
int main(int argc, char* argv[]) {
static int i = 7;
float x = 2.71828;
static double y = 3.1415926;
char c = 'w';
printf("%d, %c, %f, %lf\n", i, c, x, y);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment