QP School

Full Version: Overview of standard C library functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The C standard library provides many built-in functions to perform various operations.

#include <stdio.h>
#include <string.h>

int main() {
    // String manipulation functions
    char str1[] = "Hello";
    char str2[10];
    strcpy(str2, str1); // Copy str1 to str2
    printf("%s\n", str2); // Output: Hello

    // Mathematical functions
    double result = sqrt(25);
    printf("Square root of 25: %.2f\n", result); // Output: 5.00
    return 0;
}