C Program to Convert String into Lowercase Using Library Function

Convert Given String into Lowercase Using Library Function Program 1 : [crayon-62bece68b1d7e354678348/] Output : [crayon-62bece68b1d88350621428/] Program 2 : [crayon-62bece68b1d8b996522247/] Output : [crayon-62bece68b1d8e429655841/] Explain me ? strlwr : Converts all Letters from given String into equivalent Lowercase Letters strlwr functions is included in Header File : string.h

C Program to Copy one string into other with using library function

Copy One String Into Other Using Library Function [crayon-62bece68b2c05172174889/] Output : [crayon-62bece68b2c0c621384234/] Explain me ? Copy "str1" into "str2". Result will be stored in "str2" strcpy functions is included in Header File : string.h Functions Required : gets : For Accepting String strcpy : String Function for Copy one string into other

C Program to Concat Two Strings with using Library Function

Concat Two Strings Using Library Function [crayon-62bece68b2f86882792935/] Explain me ? Copy "str1" into "str3". Then Concat "str2" to "str3" , after concating result will be stored in "str3" strcat,strcpy functions are included in Header File : string.h Functions Required : gets : For Accepting String strcpy : String Function for Copy one string into other strcat : String Function for Concating two Strings

Sample Programs in C : String in C Example

String Programs : With Using Library Functions : Find the Length of the String Concat Two Strings Copy One String Into Other Convert given String into Uppercase String Convert given String into Lowercase String Count Total Number of Uppercase,Lowercase. Check Whether Given Character is Capital or Not Check Whether Given Character is Lowercase or Not Check Whether Entered Number is Palindrome or Not Convert String into Integer Convert String to Float Without Using Library Functions : Length of the String Concat Two Strings Reverse String Compare Two Strings Copy One String Into Other Check Whether [...]

C Program to Print 1-10 numbers without using Conditional Loops

Print 1-10 numbers without using Conditional Loop i.e without using for Loop while Loop do-while Loop This can be achieved in 3 ways : Using Printf Statement 10 Times. Using Recursive Function Using goto Statement. Recursive Main Function Way 1 : Printf Statement 10 times [crayon-62bece68b3850402775208/] Use 10 Times Printf Statement . Way 2 : Recursive Function [crayon-62bece68b3857481193600/] Recursive function : Calling Itself . printNumber function calls itself so it is called Recursive function . Way 3 : Using Goto Statement [crayon-62bece68b385a742349058/] Way 4 : Using Recursive Main [crayon-62bece68b385d831073585/] Static variable inside a function means "once the variable [...]

C Program to Print Number Pyramid Pattern

Generate Following Pattern of Pyramid Program : [crayon-62bece68b3e45163434929/] Output : [crayon-62bece68b3e4c447490663/] Explain ? [crayon-62bece68b3e4f064757288/] Gotoxy : interpret it as "goto x y" Moves Cursor Position to Co-Ordinate (x,y) gotoxy(10,40) : moves Cursor Position to Co-ordinate (10,40) [crayon-62bece68b3e52339344465/] In Each Iteration we are moving downward so increment "y" For each new Iteration we are starting from beginning but one co-ordinate back so decrement x [crayon-62bece68b3e55333994318/] Nested Loop Used to Print All the Numbers in Particular Line . i.e in the third line i = 3 so j will print values 3 times .

C Program to Calculate Area of Scalene Triangle

C Program to Find Area of Scalene Triangle : [crayon-62bece68b4573129328931/] Output : [crayon-62bece68b4579956039811/] C Program for Beginners : Area of Scalene Triangle Properties of Scalene Triangle : Scalene Triangle does not have sides having equal length. No angles of Scalene Triangle are equal. To calculate area we need at least two sides and the angle included by them. Formula to Find Area of Scalene Triangle : Explanation and Program Logic : Part 1 : M_PI [crayon-62bece68b457d024575201/] It is Constant defined in math.h Header File It contain value = 3.14 in short [...]

C Program to Calculate Area of Equilatral Triangle

C Program for Beginners : Area of Square [crayon-62bece68b48f9209520882/] Output : [crayon-62bece68b4900971391947/] Properties of Equilateral Triangle : Equilateral triangle is a triangle in which all three sides are equal . All angles are of measure 60 degree A three-sided regular polygon Formula to Calculate Area of Equilateral Triangle : Explanation of Program : First of all we have to find the value of Root 3 / 2. So we have used following statement to compute the value. [crayon-62bece68b4904662022870/] Now after computing the value of the Root 3 by 2 we have [...]

C Program to Calculate Area of Right angle Triangle

C Program for Beginners : Area of Right Angled Triangle Right angle Triangle Definition : Triangle having one angle of measure 90 degree is called Right angle Triangle. Sides of Triangle are : base , height , hypotenuse. You can compute the area of a Tr. if you know its any two sides. Program : [crayon-62bece68b4ca0273809711/] Output : [crayon-62bece68b4ca7085350918/]

C Program to Calculate Area of Circle

C Program for Beginners : Area of Circle Shape : Circle Formula : Π * r * r Definition : Ellipse in which the two axes are of equal length Plane curve generated by one point moving at a constant distance from a fixed point You can compute the area of a Circle if you know its radius. Program : [crayon-62bece68b523f236150378/] Output : [crayon-62bece68b5246677648215/]

C Program to Calculate Area of Rectangle

C Program for Beginners : Area of Rectangle Shape : Rectangle [crayon-62bece68b57ad549186924/] Definition A plane figure with 4 sides and 4 right angles and having Equal Opposite Sides Adjucent sides makes an angle of 90 degree You can compute the area of a Rectangle if you know its length and breadth Program : [crayon-62bece68b57b4188666548/] Output : [crayon-62bece68b57b7603393241/]

C Program to Print prime number Pyramid

Print prime number Pyramid in C : Pyramid Program Home Logic : Prime Numbers : Numbers that are divisible by 1 and number itself is called Prime number. This program is nothing but the pyramid of the prime numbers . To Evaluate Number is Prime or not Consecutively divide that number from 2 to n/2 Example : to find whether 17 is prime or not divide that number from 2 to (17/2 = 8) if none of the remainder is zero then the [...]

C Program to Search occurrence of Character in String

Search whether character is present in the string or not : Logic [ Algorithm ]: Accept the String from the user. Also Accept the character to be searched String is stored as array of character , then scan each array element with entered character. If it matches then increment the Counter by 1 else go for another character. [crayon-62bece68b667f858806393/] Output : [crayon-62bece68b6687339049626/] [toggle title="Download Program"]Download[/toggle]

C Program to Print the Double Pyramid Pattern

Problem Statement : Program to Print the Double Pyramid Pattern [crayon-62bece68b76e1029693134/] Output : [crayon-62bece68b76e8804678786/] Explain Me ? As the above coding is very difficult to understand , so I have divided Program in 5 Steps.Easy steps are as follow , Step 0 : Program has 7 lines i.e (0 to 6) [crayon-62bece68b76ec415117755/] Variables : i is used to trace the Current Line Variables : j is used for Subscript variable for Different Loops Variables : k is used to trace the diff array , for each new value of i [...]

C Program to Print Binary Numbers Pyramid Pattern

Problem Statement : Generate Following Pattern of Pyramid [crayon-62bece68b875e518835169/] [crayon-62bece68b8764420050436/] Program Explanation : We have declared some of the variables. We have declared count variable, [crayon-62bece68b8768215237462/] First and Third Line is Starting with 1 , while 2nd and 4th Line is starting with 0, So for first and third line count will be 1 and for even line number count will be equal to 0. Outer for loop will decide the line. In this pyramid we need to print 5 lines so we have for [...]