├── Addition of a number.c ├── Area of a circle.c ├── Find HCF.txt ├── HCF.c ├── LCM.c ├── LinearSearch.c ├── Print hello world.c ├── README.md ├── check even or odd.c ├── check leap year not .c ├── check vowel or not.c ├── factorial of a number.c ├── image ├── download (4).jpg └── readme.md ├── power.c ├── print add,sub,mul and div of a number.c ├── print integer.c └── sum of a digits.c /Addition of a number.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n1,n2,add; 5 | printf("enter the 1st nnd 2nd number\n"); 6 | scanf("%d%d",&n1,&n2); 7 | add=n1+n2; 8 | printf(" %d + %d =%d",n1,n2,add); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Area of a circle.c: -------------------------------------------------------------------------------- 1 | #include 2 | main() 3 | { 4 | float r; 5 | printf("Enter the value of radius\n"); 6 | scanf("%f",&r); 7 | printf("The area of circle is %f",3.14*r*r); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Find HCF.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kushal997-das/C-PROGRAM/7abecb0eeb426ee8d6971b6f5e1e9fe147f6f2a8/Find HCF.txt -------------------------------------------------------------------------------- /HCF.c: -------------------------------------------------------------------------------- 1 | #include 2 | main() 3 | { 4 | 5 | int a,b,high; 6 | printf("enter the two numbers a & b\n"); 7 | scanf("%d%d",&a,&b); 8 | high=a>b?a:b; 9 | for(high;high>=1;high--) 10 | if(a%high==0&&b%high==0) 11 | { 12 | printf("The HCF of %d and %d = %d",a,b,high); 13 | break; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /LCM.c: -------------------------------------------------------------------------------- 1 | #include 2 | main() 3 | { 4 | 5 | int a,b,high; 6 | printf("enter the two numbers a & b\n"); 7 | scanf("%d%d",&a,&b); 8 | high=a>b?a:b; 9 | for(high;high<=a*b;high++) 10 | if(high%a==0&&high%b==0) 11 | { 12 | printf("The LCM of %d and %d = %d",a,b,high); 13 | break; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /LinearSearch.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int search(int arr[], int n, int x) 4 | { 5 | int i; 6 | for (i = 0; i < n; i++) 7 | if (arr[i] == x) 8 | return i; 9 | return -1; 10 | } 11 | 12 | int main(void) 13 | { 14 | int arr[] = { 2, 3, 4, 10, 40 }; 15 | int x = 10; 16 | int n = sizeof(arr) / sizeof(arr[0]); 17 | int result = search(arr, n, x); 18 | (result == -1) ? printf("Element is not present in array") 19 | : printf("Element is present at index %d", 20 | result); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Print hello world.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | printf("Hello World"); 5 | } 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

Web Developement Image 4 | -------------------------------------------------------------------------------- /check even or odd.c: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | int n; 4 | printf("enter a number\n"); 5 | scanf("%d",&n); 6 | { 7 | 8 | if(n%2==0) 9 | 10 | printf("%d is even\n",n); 11 | else 12 | printf("%d is odd\n",n); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /check leap year not .c: -------------------------------------------------------------------------------- 1 | #include 2 | main() 3 | { 4 | int x; 5 | printf("enter a year"); 6 | scanf("%d",&x); 7 | if(x%100==0) 8 | { 9 | if(x%400==0) 10 | printf("leap"); 11 | } 12 | else 13 | if(x%4==0) 14 | printf("leap"); 15 | else 16 | printf("not leap year"); 17 | } 18 | -------------------------------------------------------------------------------- /check vowel or not.c: -------------------------------------------------------------------------------- 1 | #include 2 | main() 3 | { 4 | char c,lc,uc; 5 | printf("enter alphabet"); 6 | scanf("%c",&c); 7 | lc=(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'); 8 | uc=(c=='A'||c=='E'||c=='I'||c=='O'||c=='U'); 9 | if(lc||uc) 10 | printf("this alphabet is a vowel\n"); 11 | else 12 | printf("this alphabet is a consonent\n"); 13 | } 14 | -------------------------------------------------------------------------------- /factorial of a number.c: -------------------------------------------------------------------------------- 1 | #include 2 | main() 3 | { 4 | int fact=1,n,i=1; 5 | printf("enter a number"); 6 | scanf("%d",&n); 7 | while(i<=n) 8 | { 9 | fact=fact*i; 10 | i++; 11 | } 12 | printf("factorial of a number %d = %d",n,fact); 13 | } 14 | -------------------------------------------------------------------------------- /image/download (4).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kushal997-das/C-PROGRAM/7abecb0eeb426ee8d6971b6f5e1e9fe147f6f2a8/image/download (4).jpg -------------------------------------------------------------------------------- /image/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /power.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | 5 | float power(int a,int n){ 6 | float R; 7 | if(n==0) 8 | return 1; 9 | if (n==1) 10 | return a; 11 | 12 | 13 | R=power(a,n/2); 14 | printf("%f\n",R); 15 | if (n%2==0) 16 | return R*R; 17 | 18 | else 19 | 20 | return a*R*R; 21 | 22 | } 23 | 24 | int main() 25 | { 26 | float a; 27 | printf("enter the base"); 28 | scanf("%f",&a); 29 | int n; 30 | printf("enter the power of a"); 31 | scanf("%d",&n); 32 | 33 | printf("%f", power(a, n)); 34 | return 0; 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /print add,sub,mul and div of a number.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n1,n2,add,sub,mul,div; 5 | printf("enter the 1st nnd 2nd number\n"); 6 | scanf("%d%d",&n1,&n2); 7 | add=n1+n2; 8 | printf(" %d + %d =%d\n",n1,n2,add); 9 | sub=n1-n2; 10 | printf(" %d - %d =%d\n",n1,n2,sub); 11 | mul=n1*n2; 12 | printf(" %d * %d =%d\n",n1,n2,mul); 13 | div=n1/n2; 14 | printf(" %d / %d =%d\n",n1,n2,div); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /print integer.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | printf("enter the number\n"); 6 | scanf("%d",&n); 7 | printf("display the integer number and the number is %d",n); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /sum of a digits.c: -------------------------------------------------------------------------------- 1 | #include 2 | main() 3 | { 4 | int n,y=0,r; 5 | printf("enter a number"); 6 | scanf("%d",&n); 7 | while(n!=0) 8 | { 9 | r=n%10; 10 | y=y+r; 11 | n=n/10; 12 | } 13 | printf("add of digits%d",y); 14 | } 15 | --------------------------------------------------------------------------------