Sunday , January 22 2017
Home / C (page 4)

C

c program for pattern13

pattern#13

 C program for pattern making        1      21   321 4321 Here is given c program for following pattern. In the above pattern we have two triangle one is empty space triangle together with the shown triangle. That’s why we have to put the loop for empty spaces together with the loop for the shown triangle. ...

Read More »

c program to check for twin prime numbers

Here is given c program for Twin Prime numbers. But before let us see what exactly is a Twin Prime  number ? A Twin Prime number are those numbers which are prime and having a difference of 2 between the two prime numbers. Example: 11 and 13. These numbers are itself prime numbers with a difference of 2 between them ...

Read More »

C program for Kaprekar number

Here is given c program for Kaprekar number. But before what exactly is a Kaprekar number? A Kaprekar number is a number whose square can be broken/partitioned in such a manner that the sum of the partitions adds up to bring the number itself. Example: 992 = 9801 : 98+01 = 99  (hence kaprekar) // This program is however limited ...

Read More »

C program for Magic number

This is a C program for Magic number. A Magic number is a number whose sum of digits eventually leads to 1. Example#1:  19 ;  1+9 =10 ; 1+0 = 1.  Hence a magic number. Example#2:  224; 2+2+4=10; 1+0 =1.  Hence a magic number. Example#3:  874; 8+7+4=19; 1+9=10; 1+0=1.  Hence a magic number. Also Check: Java program to check for ...

Read More »

c program to print the desired shape empty or filled

First parameter should be a character to choose the shape that will be printed. It could be ‘T’ or ‘t’ for triangle, ‘R’ or ‘r’ for rectangle, ‘P’ or ‘p’ for parallelogram, ‘D’ or ‘d’ for diamond. Second parameter should be a number which identifies the height of the shape. The height should be minimum 2 for triangle, rectangle and ...

Read More »

C program to remove extra blank spaces from a file

Many a times is happens that when you copy content from a incompatible source then extra spaces are added which is due to mismatched format. To get rid of this here is program in c to remove extra blank spaces from a file.. In this content of a file are added to a new file named newfile.txt which contains content ...

Read More »

C program to remove extra lines or blank lines from a file

C program for removing line spacing from a file and copying it to another file or program to remove extra blank lines within a file. [crayon-5884687a72bac226434320/] OUTPUT: Tags: C program to remove blank lines from a file, c program to remove extra lines from a text file.

Read More »

C program for Lamport Logical Clock

Lamport Logical Clock C program

Lamport Logical Clock to find the ordering of events in a Distributed System. In Lamport Algorithm each event has its own timestamp which depends on the occuring of events in the order the message has been sent by which event of a process to whichever event. [crayon-5884687a72f9d007866501/] OUTPUT: Tags: C program for the implementation of Lamport Logical Clock, C program ...

Read More »

C program for string matching least time

C program for string matching with best time complexity. It can check/match any string you give in input in any string you have earlier provided as input.

Read More »

Program to find a substring in a given string

This program is to find a substring 1101 in a given string. This is also used for string matching . [crayon-5884687a73a14018027385/] Output:

Read More »