Skip to content

Instantly share code, notes, and snippets.

@Edward34William
Created December 16, 2020 22:53
Show Gist options
  • Save Edward34William/139cecec9e4604c1eca0aff0a29a58df to your computer and use it in GitHub Desktop.
Save Edward34William/139cecec9e4604c1eca0aff0a29a58df to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main()
{
printf("Hello World\n");
int x =50;
int y; //declaration
y = 10; //initialization
printf("%s World\n", "Hello");
printf("The value of x is %d\n", x);
printf("X; %d, Y: %d\n", x, y);
printf("Give me a radius: ");
int radius;
scanf("%d", &radius); //address-of-operator (pointer)
printf("You chose the value %d\n", radius);
char name[20]; //char array of 20 characters. '\0' takes one spot
scanf("%19s", name);
printf("Your name: %s\n", name);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment