Skip to content
Snippets Groups Projects
Commit 885f431d authored by Vignesh  C's avatar Vignesh C
Browse files

adding comment to source

parent 321fbeb2
Branches master
No related tags found
No related merge requests found
two 0 → 100755
File added
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
//function prototype
int square(int n);
int input_num();
//main function
int main(){
int hold;
hold = input_num();
int (*fnt)(int);
fnt = &square;
printf("the square root: %d\n",fnt(hold));
printf("the square rooot: %d\n",fnt(hold));
}
int square(int n){
int square(int n){ // the simple function to calculate square root
int res = n * n;
return res;
}
//function to take a input from a user
int input_num(){
char num[20];
printf("Enter the number for square: ");
printf("Enter the numberrr for square: ");
fgets(num, sizeof(num), stdin);
return atoi(num);
return atoi(num); // Convert string input to integer and return it
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment