-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.c
More file actions
36 lines (28 loc) · 727 Bytes
/
new.c
File metadata and controls
36 lines (28 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdio.h>
#include <math.h>
#include <string.h>
void squareroot(float num){
float root;
printf("Enter the number : ");
scanf("%f",&num);
root = sqrt(num);
printf("The Sqrt of %f is %.3f .", num , root);
}
// Program to compare two strings
void compstr() {
char a[100], b[100];
printf("Enter the first string: ");
scanf("%99s", a); // Reads up to 99 characters or until a whitespace
printf("\nEnter the second string: ");
scanf("%99s", b); // Reads up to 99 characters or until a whitespace
if(strcmp(a, b) == 0){
printf("\nStrings are Equal.\n");
}
else{
printf("Strings are different.\n");
}
}
int main() {
compstr();
return 0;
}