The header file for advanced mathematical functions is math.h, surprise
Code:
#include <stdio.h>
#include <math.h>
int main(){
int num=10;
int result;
result = sqrt(num);
printf("%d", result);
return 0;
}
Making a word a variable requires the use of an array, referred to as a string in this case. There's not a string data type, so you have to use a char array.
Code:
#include <stdio.h>
int main(){
char array1[50];
char array2[50];
printf("Enter your first name: ");
scanf("%s", array1);
printf("Your first name is %s\nEnter your whole name: ", array1);
scanf("%[^\n]", array2);
printf("Your whole name is %s", array2);
}
The first scanf will allow you to enter a single word, but as soon as it reads in a space it will stop. The second scanf will read until it sees a newline, meaning it will read into the array until it reaches the point where you hit enter.