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


Character array c / character array java

Character array in c and character array in java can be implemented in two ways:   1. Character array using pointers:  Using pointer you can assign a string value to a character array however it will still work as an character array not as a string. The pointer will point to the first index of your assigned string. char *arr=”hello”;      or char ...

Read More »

How to Null a string or empty a string array

Null a String/ Empty a string array Null a string in C using pointer string or array string. Many times the string is nullified assigning arr[0]=’\0′ but this will not nullify the array as only the first index will be NULL.   1. Null a string using pointer string. [crayon-58846881ac8e8478353433/]   TO show that array/pointer is not actually empty or ...

Read More »

C Program to count prime numbers in given range

This is the program to count total number of Prime numbers with in 1 to specified range  [crayon-58846881acd18453736544/] Output These are the some sample output which you can check using this programs. 1 10 4 2 100 25 3 1,000 168 4 10,000 1,229 5 100,000 9,592 6 1,000,000 78,498 7 10,000,000 664,579 8 100,000,000 5,761,455 9 1,000,000,000 50,847,534 tags: ...

Read More »

C Program for Bit Stuffing

Bit stuffing in network lab C C++ programming

Bit Stuffing: In bit stuffing following rules hold:-  To the given bits add the string 01111110 to both the starting and the end of the string To add 0 to each set of 5 one’s i.e. after every five consecutive 1’s appear a zero [crayon-58846881ad4b9324981886/]   OUTPUT:   Tags: Write a C program for bit stuffing, bit-stuffing

Read More »

C Program to implement CRC (Cyclic Redundancy Code)

Cyclic Redundancy Code

This is a C Program for implementing CRC (Cyclic Redundancy Check Code) [crayon-58846881ae0da213035045/] Output:   tags: Error Checking and Correction, CRC program, C program of CRC,Cyclic Redundancy Check Code, protocols

Read More »

C Program for Add two Numbers Using Pointers without Operators

C Program for Add two Numbers Using Pointers without Operators | C program to  sum up two nos This is the simple c program which takes two numbers as input and give addition of those number as output. this program doesn’t use any operator for that purpose.  Program 1: C program to add two numbers using pointers | Without using operators  ...

Read More »

C Program for Implementation of Regular Expession

C Program for implementing DFA of Regular Expression (a+aa*b)* In this program you have to enter a string and output will be shown as  whether string will be accepted or not. Program is implemented using transition table not jumping on different states. It can be easily modifiable for other regular expressions.  [crayon-58846881af852677842140/] OUTPUT: If you find any difficulty in this ...

Read More »

C Program for Recursive Descent Parser

C Program for implementation of Recursive Descent Parser for language given below E-> TE’ E’-> +TE’ | -TE’ | null T-> FT’ T’-> *FT’| /FT’ | null F-> id/ (E)/ num Here ‘id’ can be a single letter. And ‘num’ can be a single digit number. [crayon-58846881b0065604148850/] OUTPUT: If you like this then please share this page. You can comment ...

Read More »

Find the elements which created the smallest partial sum modulo P that is at least K

In this problem, you will be given such a sequence and two integers P and K. Your task is to find the elements which created the smallest partial sum modulo P that is at least K.   For example, consider the following sequence of integers: 12     13     15     11     16     26     11 Here N = 7. Suppose K = 0 the answer is 0 since 12 + 13 + 15 ...

Read More »

C Program for Binary Search Tree (BST)

This is a c program for Binary search tree. In a BST smaller element is the left child and larger element is the right child.    DOWNLOAD THE .C FILE OF BST USING THIS LINK:- C program for binary search tree(bst)     OUTPUT:   Tags:  c program for bst, c program for binary search tree.  

Read More »