Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
c-programming
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vignesh C
c-programming
Commits
885f431d
Commit
885f431d
authored
2 days ago
by
Vignesh C
Browse files
Options
Downloads
Patches
Plain Diff
adding comment to source
parent
321fbeb2
Branches
master
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
two
+0
-0
0 additions, 0 deletions
two
two.c
+10
-12
10 additions, 12 deletions
two.c
with
10 additions
and
12 deletions
two
0 → 100755
+
0
−
0
View file @
885f431d
File added
This diff is collapsed.
Click to expand it.
two.c
+
10
−
12
View file @
885f431d
#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 number
rr
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment