My name is c

#include <stdio.h>

int main() {
    char name[] = "c";

    printf("My name is %s.\n", name);

    return 0;
}

Explanation:

  1. #include <stdio.h>: Includes the standard input-output library in the C program to use functions like printf().

  2. int main() { ... }: Defines the main function, the entry point of the program where execution begins. int specifies the return type of the function, and main() is the function name. The curly braces {} mark the beginning and end of the main function's body.

  3. char name[] = "c";: Declares a character array named name and initializes it with the string "c", which is the name assigned.

  4. printf("My name is %s.\n", name);: Displays the formatted output to the console. %s is a format specifier used for strings. The value of the name array is printed in place of %s. \n represents a newline character, which moves the cursor to the next line after printing.

  5. return 0;: Indicates the end of the main() function. It returns an integer value 0 to the operating system, signifying successful execution of the program.