Thursday , February 23 2017
Home / C (page 3)

C

c program to find the square root of a number without using sqrt()

Can you write a c program to find the square root of a number without using sqrt() function or other predefined functions. This has been a great challenge in interview as you can do it by using newtons algorithm which you should previously know for implementing. However here are mentioned some useful methods to solve this question.  

Read More »

c program for diamond shape pattern #16

This is a C program for diamond shape pattern which can be both filled and empty. However this choice is left for the user who can enter their choice as per their requirement. [crayon-58ae09f083b30437765486/] Explanation:  1. the character will print if it is in the boundary condition of the pattern i.e the first ( j==1 ) character or the last ...

Read More »

c program for pattern#12

Pattern#12 [crayon-58ae09f08470d597636090/] This pattern is also an easy one , where you have to indent each line accordingly. Here you can observe that the indentation is directly related to the numbers in each row. If no. of lines are n . then for ith row output is= (n-i)Blank spaces + (1 to i) numbers  Also check: Alternate Java program for pattern#12 ...

Read More »

c program for pattern#14

Pattern #14 [crayon-58ae09f084b1f170659252/] This is a tricky pattern where you have to reduce your coding otherwise it easy using if statement . Can you do it without if statement? Also see: Alternate Java program for pattern#14 [crayon-58ae09f084b28314823807/] OUTPUT:

Read More »

c program for pattern#15

[crayon-58ae09f084f32825091188/] This is a simple pyramid pattern which can be implemented using nested loop – either while or for loop. [crayon-58ae09f084f3b566992786/] OUTPUT:

Read More »

c program for pattern#6

Pattern#6 [crayon-58ae09f0853b0086707650/] Also see : Alternate Java program for pattern#6 [crayon-58ae09f0853ba477231861/] OUTPUT :

Read More »

c program for Star Pattern

c program for Star Pattern [crayon-58ae09f0857e4193420664/] Also see : Alternate Java program for pattern#6 [crayon-58ae09f0857ed624892395/] OUTPUT :

Read More »

c program to print fibonacci numbers using recursion

Fibonacci numbers using recursion You must have already come across program to print fibonacci numbers without recursion, Here is given fbonacci number series using recursion. PROS or New concept used: 1. You DONT have to print 0 and 1 first and run the loop n-2 times. 2. Giving modularity to program since recursion uses function or method thus decreases complexity ...

Read More »

C program for binary to decimal conversion

Here is given c program for binary to decimal conversion. But before let us see what is a Binary number is? A binary number is a number formed using only two digits i.e 1 or 0. A Decimal number is a number with base 10 which is in used very efficiently for manually calculations.Let us understand the conversion process through ...

Read More »

c program to print first 20 fibonacci numbers

This is a c program to print fibonacci numbers where fibonacci numbers are those where every next number in the series is the sum of the previous two numbers and the series starts with the former numbers 0 and 1. So fibonacci series is: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 ….. so on.

Read More »