C Program find whether a Number is Prime Or Composite using Recursion

prime number

C Program find whether a Number is Prime Or Composite using Recursion Prime Number: A number that is only divisible by 1 and itself. Composite Number: A number that is not a prime number. Note: 1 is neither prime nor composite. Below is a program to find whether the user input number is a prime number or a … Read more

C program to find the length of a String without using function strlen()

#include <stdio.h> int main() { char str[100],i; printf(“Enter a string: \n”); scanf(“%s”,str); for(i=0; str[i]!=’\0′; ++i); printf(“\nLength of input string: %d”,i); return 0; }  

C Program to find LCM of two Numbers using Recursion

LCM program example in c

C Program to find LCM of two Numbers using Recursion What is LCM LCM: Least Common Multiple of two numbers is the number that is a common multiple of the both the numbers. Below is a program to find LCM of two numbers using recursion. #include<stdio.h> int find_lcm(int, int); // function prototype declaration int main() { … Read more

c program example function prototype

c program example function prototype

c program example function prototype   What would be the output of the following programs: main( ) { float area ; int radius = 1 ; area = circle ( radius ) ; printf ( “\n%f”, area ) ; } circle ( int r )

conditional operators c program example

c program for egg game

conditional operators c program example         What would be the output of the following programs: main( ) { int k, num = 30 ; k = ( num > 5 ? ( num <= 10 ? 100 : 200 ) : 500 ) ; printf ( “\n%d”, num ) ; }   … Read more

binary search program in C

binary search program in C Overview: C Program for binary search This is a program of binary search in C language. It can only be used for sorted arrays, but it’s fast as compared to linear search. If you wish to use binary search on an array which isn’t sorted, then you must sort it … Read more

C switch case program to read weekday number and print weekday name

C Programming Tutorial

C switch case program to read weekday number and print weekday name This program will read weekday number (0-6) and print weekday name (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday)   Weekday Number Weekday Name 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday Program Example: #include <stdio.h> int main() … Read more

C Program to Check Even or Odd number

turbo c++ program editor

C Program to Check Even or Odd number : C Program Example An even number is an integer that is exactly divisible by 2. Example: 2,4,6, 8,10,12,14,16 etc An odd number is an integer that is not exactly divisible by 2. Example: 1, 3,5,7, 9,11, 15,17 etc C Program start from here #include int main() … Read more