Skip to content

Basics of understanding C language by studying data types, functions, loops, etc...

License

Notifications You must be signed in to change notification settings

David2261/C_Zen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Base_C

Tools

  • C
  • Debian 10.2.1-6
  • gcc 10.2.1
  • GNU Make 4.3

Description

All programs are written by ME in C! To compile the file more easily, I wrote a Makefile, with which you can also run programs. All binary files are stored in the build directory.

Project structure

  • Functions -- Soft
  • Lessons
  • Math
  • SMP
  1. In the Functions directory, simple programs are written thet perform operations such as: bubble sort, character matching, palidrom, reverse, etc.
  2. In the Lessons directory, written in inside this repository in a file Readme
  3. In the Math directory, simple programs are written thet perform operations such as: averange size, exponentiation, recursion, etc.
  4. In the UsefulExp directory, various functions from Kernighan Ritchie's book have been written.
  5. In the SMP directory, I wrote simple C function patterens.

Example

int main() {
    int N = 0;
    if (scanf("%d", &N) != 1 || N < 1) {
        printf("n/a\n");
        return 1;
    }
    struct Human arr[N];
    
    for (int i = 0; i < N; i++) {
        scanf("%s", arr[i].Name);
        scanf("%s", arr[i].Surname);
        if (scanf("%lf", &arr[i].size) != 1 || arr[i].size < 1) {
            printf("n/a\n");
            return 1;
        }
    }
    
    char name[100];
    scanf("%s", name);
    
    printf("str = %s\nname = %s\n", arr[0].Name, name);
    
    int count = 0;
    double sum = 0;
    
    for (int i = 0; i < N; i++) {
        if (strcmp21(name, arr[i].Name) == 0) {
            count++;
            sum += arr[i].size * 1.0;
            printf("%s, ", arr[i].Surname);
        }
    }
    printf("\b\b");
    printf(" : %0.lf\n", (sum / count));
    
    return 0;
}

About

Basics of understanding C language by studying data types, functions, loops, etc...

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published