Search This Blog
Translate
array in c | accept array element and print c program
array in c | accept array element and print c program
Free C-Programming ebooks Download
Download C Programming Book
---------------------------------------------------
C programming books designed to help you better understand and study programming in C, Free C-Programming ebooks Download , Free C-Programming programming ebooks download,Download free C-Programming Ebook and C-Programming Programming Ebook,C Programming, Objective-C Programming
http://imojo.in/5y8g8c
http://imojo.in/5y8g8chttp://imojo.in/5y8g8chttp://imojo.in/5y8g8chttp://imojo.in/5y8g8c
http://imojo.in/5y8g8c
c programming basics PDF click here To Download
c programming basics PDF click here To Download
http://imojo.in/5y8g8c
people search by using :
- Free C-Programming ebooks Download
- c programming book by dennis ritchie pdf free download
- c language books by balaguruswamy free download
- c programs pdf with output free download
- c programming book by balaguruswamy free pdf
- c programming language pdf for beginners
- c language yashwant kanetkar pdf
- learn c programming step by step pdf
- notes of c language pdf
multiply two matrix by recursion:
matrix multiplication recursive algorithm
multiplication using recursion in c
recursive matrix multiplication java same logic
matrix multiplication using divide and conquer in c
using recursion in c find the largest element in an array
strassen's matrix multiplication program in c using divide and conquer
matrix addition using recursion
strassen matrix multiplication code in c
#include<stdio.h>
#define MAX 10
void multiplyMatrix(int [MAX][MAX],int [MAX][MAX]);
int m,n,o,p;
int c[MAX][MAX];
void main(){
int a[MAX][MAX],b[MAX][MAX],i,j,k;
printf("Enter the row and column of first matrix: ");
scanf("%d %d",&m,&n);
printf("Enter the row and column of second matrix: ");
scanf("%d %d",&o,&p);
if(n!=o){
printf("Matrix multiplication is not possible");
printf("\nColumn of first matrix must be same as row of second matrix");
}
else{
printf("Enter the First matrix: ");
for(i=0;i<m;i++)
for(j=0;j<n;j++)
scanf("%d",&a[i][j]);
printf("Enter the Second matrix: ");
for(i=0;i<o;i++)
for(j=0;j<p;j++)
scanf("%d",&b[i][j]);
printf("\nyour First matrix is: \n");
for(i=0;i<m;i++){
printf("\n");
for(j=0;j<n;j++){
printf("%d\t",a[i][j]);
}
}
printf("\nyour Second matrix is: \n");
for(i=0;i<o;i++){
printf("\n");
for(j=0;j<p;j++){
printf("%d\t",b[i][j]);
}
}
multiplyMatrix(a,b);
}
printf("\n multiplication of two matrix is: \n");
for(i=0;i<m;i++){
printf("\n");
for(j=0;j<p;j++){
printf("%d\t",c[i][j]);
}
}
}
void multiplyMatrix(int a[MAX][MAX],int b[MAX][MAX]){
static int sum,i=0,j=0,k=0;
if(i<m){ //row of first matrix
if(j<p){ //column of second matrix
if(k<n){
sum=sum+a[i][k]*b[k][j];
k++;
multiplyMatrix(a,b);
}
c[i][j]=sum;
sum=0;
k=0;
j++;
multiplyMatrix(a,b);
}
j=0;
i++;
multiplyMatrix(a,b);
}
}
- matrix multiplication recursive algorithm
- multiplication using recursion in c
- recursive matrix multiplication java same logic
- matrix multiplication using divide and conquer in c
- using recursion in c find the largest element in an array
- strassen's matrix multiplication program in c using divide and conquer
- matrix addition using recursion
- strassen matrix multiplication code in c
count no of occurrences in linked list using recursion
write a program to count the number of times an item is present in a linked list.
count nodes in linked list c++
algorithm to count the number of nodes in linked list
how to count the number of nodes in a linked list java
linked list count java
count the number of nodes in a circular linked list
c program to find the occurrence of a digit in a number
wap to reverse the elements in a single linked list.
Program to count no of occurrences in linked list using recursion
#include <stdio.h>void occur(int [], int, int, int, int *);
int main()
{ int size, key, count = 0;
int list[20]; int i;
printf("Enter the size of the list: ");
scanf("%d", &size);111
printf("Printing the list:\n");
for (i = 0; i < size; i++)
{ printf("\nenter the %d element\n",i+1);
scanf("%d",&list[i]);
}
for (i = 0; i < size; i++)
{
printf("%d ", list[i]);
}
printf("\nEnter the key to find it's occurence: ");
scanf("%d", &key);
occur(list, size, 0, key, &count);
printf("%d occurs for %d times.\n", key, count);
return 0;
}
void occur(int list[], int size, int index, int key, int *count)
{
if (size == index)
{
return;
}
if (list[index] == key) { *count += 1;
}
occur(list, size, index + 1, key, count);
}
- write a program to count the number of times an item is present in a linked list.
- count nodes in linked list c++
- algorithm to count the number of nodes in linked list
- how to count the number of nodes in a linked list java
- linked list count java
- count the number of nodes in a circular linked list
- c program to find the occurrence of a digit in a number
- wap to reverse the elements in a single linked list.
C Program to Demonstrate Circular Single Linked List
circular linked list in c source code
circular linked list in c algorithm
circular linked list insertion and deletion
circular linked list in c++
circular linked list in c geeksforgeeks
c program for doubly linked list
circular linked list in c pdf
circular linked list code java
C Program to Demonstrate Circular Single Linked List
#include <stdio.h>
#include <stdlib.h>
struct node { int data; struct node *link; };
struct node *head = NULL, *x, *y, *z;
void create();
void ins_at_beg();
void ins_at_pos();
void del_at_beg();
void del_at_pos();
void traverse();
void search();
void sort();
void update();
void rev_traverse(struct node *p);
int main() {
int ch;
printf("\n 1.Creation \n 2.Insertion at beginning \n 3.Insertion at remaining");
printf("\n4.Deletion at beginning \n5.Deletion at remaining \n6.traverse"); printf("\n7.Search\n8.sort\n9.update\n10.Exit\n");
while (1) { printf("\n Enter your choice:");
scanf("%d", &ch);
switch(ch)
{ case 1: create(); break; case 2: ins_at_beg(); break; case 3: ins_at_pos(); break; case 4: del_at_beg(); break; case 5: del_at_pos(); break; case 6: traverse(); break; case 7: search(); break; case 8: sort(); break; case 9: update(); break; case 10: rev_traverse(head); break; default: exit(0); } } return 0; }
/*Function to create a new circular linked list*/
void create() { int c; x = (struct node*)malloc(sizeof(struct node)); printf("\n Enter the data:"); scanf("%d", &x->data); x->link = x; head = x; printf("\n If you wish to continue press 1 otherwise 0:"); scanf("%d", &c); while (c != 0) { y = (struct node*)malloc(sizeof(struct node)); printf("\n Enter the data:"); scanf("%d", &y->data); x->link = y; y->link = head; x = y; printf("\n If you wish to continue press 1 otherwise 0:"); scanf("%d", &c); } }
/*Function to insert an element at the begining of the list*/
void ins_at_beg() { x = head; y = (struct node*)malloc(sizeof(struct node)); printf("\n Enter the data:"); scanf("%d", &y->data); while (x->link != head) { x = x->link; } x->link = y; y->link = head; head = y; }
/*Function to insert an element at any position the list*/
void ins_at_pos() { struct node *ptr; int c = 1, pos, count = 1; y = (struct node*)malloc(sizeof(struct node)); if (head == NULL) { printf("cannot enter an element at this place"); } printf("\n Enter the data:"); scanf("%d", &y->data); printf("\n Enter the position to be inserted:"); scanf("%d", &pos); x = head; ptr = head; while (ptr->link != head) { count++; ptr = ptr->link; } count++; if (pos > count) { printf("OUT OF BOUND"); return; } while (c < pos) { z = x; x = x->link; c++; } y->link = x; z->link = y; }
/*Function to delete an element at any begining of the list*/
void del_at_beg() { if (head == NULL) printf("\n List is empty"); else { x = head; y = head; while (x->link != head) { x = x->link; } head = y->link; x->link = head; free(y); } }
/*Function to delete an element at any position the list*/
void del_at_pos() { if (head == NULL) printf("\n List is empty"); else { int c = 1, pos; printf("\n Enter the position to be deleted:"); scanf("%d", &pos); x = head; while (c < pos) { y = x; x = x->link; c++; } y->link = x->link; free(x); } }
/*Function to display the elements in the list*/
void traverse() { if (head == NULL) printf("\n List is empty"); else { x = head; while (x->link != head) { printf("%d->", x->data); x = x->link; } printf("%d", x->data); } }
/*Function to search an element in the list*/
void search() { int search_val, count = 0, flag = 0; printf("\nenter the element to search\n"); scanf("%d", &search_val); if (head == NULL) printf("\nList is empty nothing to search"); else { x = head; while (x->link != head) { if (x->data == search_val) { printf("\nthe element is found at %d", count); flag = 1; break; } count++; x = x->link; } if (x->data == search_val) { printf("element found at postion %d", count); } if (flag == 0) { printf("\nelement not found"); } } }
/*Function to sort the list in ascending order*/
void sort() { struct node *ptr, *nxt; int temp; if (head == NULL) { printf("empty linkedlist"); } else { ptr = head; while (ptr->link != head) { nxt = ptr->link; while (nxt != head) { if (nxt != head) { if (ptr->data > nxt->data) { temp = ptr->data; ptr->data = nxt->data; nxt->data = temp; } } else { break; } nxt = nxt->link; } ptr = ptr->link; } } }
/*Function to update an element at any position the list*/
void update() { struct node *ptr; int search_val; int replace_val; int flag = 0; if (head == NULL) { printf("\n empty list"); } else { printf("enter the value to be edited\n"); scanf("%d", &search_val); fflush(stdin); printf("enter the value to be replace\n"); scanf("%d", &replace_val); ptr = head; while (ptr->link != head) { if (ptr->data == search_val) { ptr->data = replace_val; flag = 1; break; } ptr = ptr->link; } if (ptr->data == search_val) { ptr->data = replace_val; flag = 1; } if (flag == 1) { printf("\nUPdate sucessful"); } else { printf("\n update not successful"); } } }
/*Function to display the elements of the list in reverse order*/
void rev_traverse(struct node *p) { int i = 0; if (head == NULL) { printf("empty linked list"); } else { if (p->link != head) { i = p->data; rev_traverse(p->link); printf(" %d", i); } if (p->link == head) { printf(" %d", p->data); } } }
- circular linked list in c source code
- circular linked list in c algorithm
- circular linked list insertion and deletion
- circular linked list in c++
- circular linked list in c geeksforgeeks
- c program for doubly linked list
- circular linked list in c pdf
- circular linked list code java
Create a linked list and display the elements in the list
simple linked list program in c
linked list program in c with explanation
linked list program in c++
linked list program in c for insertion and deletion
singly linked list program in data structure using c
linked list program in c pdf
how to create a linked list in c++
how to create a linked list java
Create a linked list and display the elements in the list
#include <stdio.h>#include <malloc.h>
#include <stdlib.h>
void main() {
struct node { int num; struct node *ptr;
};
typedef struct node NODE; NODE *head, *first, *temp = 0; int count = 0; int choice = 1; first = 0; while (choice)
{ head = (NODE *)malloc(sizeof(NODE));
printf("Enter the data item\n"); scanf("%d", &head-> num);
if (first != 0) { temp->ptr = head; temp = head; }
else { first = temp = head; } fflush(stdin);
printf("Do you want to continue(Type 0 or 1)?\n");
scanf("%d", &choice); } temp->ptr = 0;
/* reset temp to the beginning */
temp = first; printf("\n status of the linked list is\n");
while (temp != 0)
{ printf("%d=>", temp->num); count++; temp = temp -> ptr; }
printf("NULL\n"); printf("No. of nodes in the list = %d\n", count);
}
- simple linked list program in c
- linked list program in c with explanation
- linked list program in c++
- linked list program in c for insertion and deletion
- singly linked list program in data structure using c
- linked list program in c pdf
- how to create a linked list in c++
- how to create a linked list java
Convert a given Singly Linked List to a Circular List
Sorted insert for circular linked list
C Program to Convert a given Singly Linked List to a Circular List
C program to convert a singly linked list to circular
c++ - How to convert singly linked list to circular list
c - Conversion from single to circular linked list
Sorted insert for circular linked list
C Program to Convert a given Singly Linked List to a Circular List
#include <stdio.h>#include <stdlib.h>
struct node { int num; struct node *next; };
void create(struct node **);
void tocircular(struct node **);
void release(struct node **);
void display(struct node *);
int main() {
struct node *p = NULL;
int result, count;
printf("Enter data into the list\n");
create(&p);
tocircular(&p);
printf("Circular list generated\n");
display(p); release (&p); return 0; }
void tocircular(struct node **p)
{ struct node *rear; rear = *p; while (rear->next != NULL)
{ rear = rear->next; } rear->next = *p; /*After this the singly linked list is now circular*/ }
void create(struct node **head)
{ int c, ch; struct node *temp; do
{ printf("Enter number: ");
scanf("%d", &c); temp = (struct node *)malloc(sizeof(struct node));
temp->num = c; temp->next = *head; *head = temp;
printf("Do you wish to continue [1/0]: ");
scanf("%d", &ch); }
while (ch != 0); printf("\n");
}
void display(struct node *head)
{ struct node *temp = head;
printf("Displaying the list elements\n");
printf("%d\t", temp->num);
temp = temp->next;
while (head != temp)
{ printf("%d\t", temp->num);
temp = temp->next; }
printf("and back to %d\t%d ..\n", temp->num, temp->next->num); }
void release(struct node **head)
{ struct node *temp = *head; temp = temp->next;
(*head)->next = NULL;
(*head) = temp->next;
while ((*head) != NULL) {
free(temp); temp = *head;
(*head) = (*head)->next; }
}
- Sorted insert for circular linked list
- C Program to Convert a given Singly Linked List to a Circular List
- C program to convert a singly linked list to circular
- c++ - How to convert singly linked list to circular list
- c - Conversion from single to circular linked list
- Sorted insert for circular linked list
Construct a Balanced Binary Search Tree
C Program to Construct a Balanced Binary Search Tree which has same data members as the given Doubly Linked List
#include <stdio.h>
#include <stdlib.h>
struct node { int num; struct node *left; struct node *right; };
void create(struct node **);
void treemaker(struct node **, int);
void display(struct node *);
void displayTree(struct node *);
void ddelete(struct node **);
int main()
{ struct node *headList = NULL, *rootTree,
*p;
int count = 1, flag = 0;
create(&headList);
printf("Displaying the doubly linked list:\n");
display(headList);
rootTree = p = headList;
while (p->right != NULL)
{ p = p->right; count = count + 1;
if (flag) { rootTree = rootTree->right; }
flag = !flag; } treemaker(&rootTree, count / 2);
printf("Displaying the tree: (Inorder)\n"); displayTree(rootTree);
printf("\n"); return 0; } void create(struct node **head)
{ struct node *rear, *temp; int a, ch; do { printf("Enter a number: ");
scanf("%d", &a); temp = (struct node *)malloc(sizeof(struct node));
temp->num = a; temp->right = NULL;
temp->left = NULL;
if (*head == NULL)
{ *head = temp; }
else { rear->right = temp; temp->left = rear; }
rear = temp; printf("Do you wish to continue [1/0] ?: "); scanf("%d", &ch); }
while (ch != 0); } void treemaker(struct node **root, int count)
{ struct node *quarter, *thirdquarter;
int n = count, i = 0;
if ((*root)->left != NULL)
{ quarter = (*root)->left; for (i = 1; (i < count / 2) && (quarter->left != NULL); i++)
{ quarter = quarter->left; }
(*root)->left->right = NULL; (*root)->left = quarter;
/* * Uncomment the following line to see when the pointer changes */ //
printf("%d's left child is now %d\n", (*root)->num, quarter->num);
if (quarter != NULL)
{ treemaker(&quarter, count / 2); } }
if ((*root)->right != NULL)
{ thirdquarter = (*root)->right;
for (i = 1; (i < count / 2) && (thirdquarter->right != NULL); i++)
{ thirdquarter = thirdquarter->right; } (*root)->right->left = NULL; (*root)->right = thirdquarter;
/* * Uncomment the following line to see when the pointer changes */ /
/printf("%d's right child is now %d\n", (*root)->num, thirdquarter->num);
if (thirdquarter != NULL)
{ treemaker(&thirdquarter, count / 2); } } }
void display(struct node *head)
{ while (head != NULL)
{ printf("%d ", head->num);
head = head->right; }
printf("\n");
}
/*DisplayTree performs inorder traversal*/
void displayTree(struct node *root)
{ if (root != NULL) { displayTree(root->left);
printf("%d ", root->num); displayTree(root->right); } }
void ddelete(struct node **root)
{ if (*root != NULL) { displayTree((*root)->left);
displayTree((*root)->right);
free(*root); }
}
- convert sorted list to binary search tree
- sorted array to balanced bst
- convert sorted array to binary search tree leetcode
- binary tree using array in c program
- what is balanced binary search tree
- create bst from unsorted array
- create binary tree from array java
- binary tree array implementation c++
Check whether 2 linked Lists are Same
compare two linked lists java
compare two linked lists c++
compare two linked lists hackerrank solution
check if two linked lists are equal java
how to compare two nodes in linked list java
how would you detect a loop in a linked list?
how will you implement three stacks with one array?
merge two sorted linked lists
C Program to Check whether 2 Lists are Same
#include <stdio.h>
#include <stdlib.h>
struct node { int num; struct node *next; };
void feedmember(struct node **);
int compare (struct node *, struct node *);
void release(struct node **);
int main()
{ struct node *p = NULL;
struct node *q = NULL;
int result; printf("Enter data into first list\n");
feedmember(&p);
printf("Enter data into second list\n");
feedmember(&q); result = compare(p, q);
if (result == 1)
{ printf("The 2 list are equal.\n"); }
else { printf("The 2 lists are unequal.\n"); }
release (&p); release (&q); return 0; }
int compare (struct node *p, struct node *q)
{ while (p != NULL && q != NULL)
{ if (p->num != q-> num) { return 0; }
else { p = p->next; q = q->next; } }
if (p != NULL || q != NULL) { return 0; }
else { return 1; }
}
void feedmember (struct node **head)
{ int c, ch; struct node *temp;
do { printf("Enter number: "); scanf("%d", &c); temp = (struct node *)malloc(sizeof(struct node));
temp->num = c; temp->next = *head; *head = temp; printf("Do you wish to continue [1/0]: "); scanf("%d", &ch); } while (ch != 0); printf("\n"); } void release (struct node **head) { struct node *temp = *head; while ((*head) != NULL) { (*head) = (*head)->next; free(temp); temp = *head; } }
- compare two linked lists java
- compare two linked lists c++
- compare two linked lists hackerrank solution
- check if two linked lists are equal java
- how to compare two nodes in linked list java
- how would you detect a loop in a linked list?
- how will you implement three stacks with one array?
- merge two sorted linked lists
Check whether a Singly Linked List is a Palindrome
palindrome checking using doubly linked list in c
java program palindrome with linked lists
palindrome linked list python
a sorted array has been rotated r times to the left. find r in least possible time.
given a string, find the largest palindrome substring.
doubly linked list palindrome
palindrome list geeks
palindrome list interviewbit
C Program to Check whether a Singly Linked List is a Palindrome
#include <stdio.h> #include <stdlib.h>
struct node { int num; struct node *next; };
int create(struct node **);
int palin_check (struct node *, int);
void release(struct node **);
int main()
{ struct node *p = NULL;
int result, count; printf("Enter data into the list\n");
count = create(&p); result = palin_check(p, count);
if (result == 1) { printf("The linked list is a palindrome.\n"); }
else {
printf("The linked list is not a palindrome.\n"); }
release (&p); return 0; }
int palin_check (struct node *p, int count) { int i = 0, j;
struct node *front, *rear;
while (i != count / 2) { front = rear = p; for (j = 0; j < i; j++
) { front = front->next; }
for (j = 0; j < count - (i + 1); j++) { rear = rear->next; } if (front->num != rear->num)
{ return 0; }
else { i++; } } return 1; } int create (struct node **head)
{ int c, ch, count = 0; struct node *temp; do { printf("Enter number: ");
scanf("%d", &c); count++;
temp = (struct node *)
malloc(sizeof(struct node)); temp->num = c; temp->next = *head; *head = temp; printf("Do you wish to continue [1/0]: ");
scanf("%d", &ch); } while (ch != 0); printf("\n"); return count; }
void release (struct node **head) { struct node *temp = *head; while ((*head) != NULL)
{ (*head) = (*head)->next; free(temp); temp = *head; }
}
- palindrome checking using doubly linked list in c
- java program palindrome with linked lists
- palindrome linked list python
- a sorted array has been rotated r times to the left. find r in least possible time.
- given a string, find the largest palindrome substring.
- doubly linked list palindrome
- palindrome list geeks
- palindrome list interviewbit
Add Corresponding Positioned Elements of 2 Linked Lists
add two numbers represented by linked lists
add two linked lists c++
given a linked list of 0s, 1s and 2s, sort it.
linked list sum java
add two numbers represented by linked lists leetcode
sum of elements in linked list in c
subtract two numbers represented by linked list
add two numbers represented by linked lists c++
C Program to Add Corresponding Positioned Elements of 2 Linked Lists
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
struct node { int num; struct node *next; };
int feednumber(struct node **);
struct node *addlist(struct node *, struct node *, int, int);
void release(struct node **);
void display(struct node *);
int main() { struct node *p = NULL; struct node *q = NULL; struct node *res = NULL; int pcount = 0, qcount = 0; printf("Enter first number\n");
pcount = feednumber(&p);
printf("Enter second number\n");
qcount = feednumber(&q);
printf("Displaying list1: ");
display(p); printf("Displaying list2: ");
display(q); res = addlist(p, q, pcount, qcount);
printf("Displaying the resulting list: ");
display(res); release(&p); release(&q); release(&res); return 0; }
/*Function to create nodes of numbers*/
int feednumber(struct node **head)
{ char ch, dig; int count = 0; struct node *temp, *rear = NULL;
ch = getchar();
while (ch != '\n') { dig = atoi(&ch);
temp = (struct node *)malloc(sizeof(struct node));
temp->num = dig; temp->next = NULL;
count++;
if ((*head) == NULL) { *head = temp; rear = temp; }
else { rear->next = temp; rear = rear->next; }
ch = getchar(); } return count; }
/*Function to display the list of numbers*/
void display (struct node *head)
{ while (head != NULL) { printf("%d", head->num); head = head->next; }
printf("\n"); } /*Function to free the allocated list of numbers*/
void release (struct node **head)
{ struct node *temp = *head; while ((*head) != NULL)
{ (*head) = (*head)->next; free(temp); temp = *head; } }
/*Function to add the list of numbers and store them in 3rd list*/
struct node *addlist(struct node *p, struct node *q, int pcount, int qcount)
{
struct node *ptemp, *qtemp, *result = NULL, *temp; int i, carry = 0;
while (pcount != 0 && qcount != 0)
{ ptemp = p; qtemp = q; for (i = 0; i < pcount - 1; i++)
{ ptemp = ptemp->next; } for (i = 0; i < qcount - 1; i++)
{ qtemp = qtemp->next; } temp = (struct node *) malloc (sizeof(struct node));
temp->num = ptemp->num + qtemp->num + carry;
carry = temp->num / 10; temp->num = temp->num % 10; temp->next = result; result = temp; pcount--; qcount--; } /*both or one of the 2 lists have been read completely by now*/ while (pcount != 0) { ptemp = p; for (i = 0; i < pcount - 1; i++) { ptemp = ptemp->next; }
temp = (struct node *) malloc (sizeof(struct node));
temp->num = ptemp->num + carry; carry = temp->num / 10;
temp->num = temp->num % 10; temp->next = result; result = temp; pcount--; }
while (qcount != 0) { qtemp = q; for (i = 0; i < qcount - 1; i++)
{ qtemp = qtemp->next; }
temp = (struct node *) malloc (sizeof(struct node));
temp->num = qtemp->num + carry; carry = temp->num / 10;
temp->num = temp->num % 10;
temp->next = result; result = temp; qcount--; }
return result; }
- add two numbers represented by linked lists
- add two linked lists c++
- given a linked list of 0s, 1s and 2s, sort it.
- linked list sum java
- add two numbers represented by linked lists leetcode
- sum of elements in linked list in c
- subtract two numbers represented by linked list
- add two numbers represented by linked lists c++
Draw x And Y axis Center Of Screen Using C program
graphics program in c to draw a moving car
c graphics program for animation
graphics programming in c with output
graphics programming in c examples
simple graphics program in c to draw a line
c program to draw a square using graphics
graphics programming in c pdf
c program to draw a rectangle using graphics
Draw x And Y axis Center Of Screen Using C program
#include<conio.h>
#include<graphics.h>
#include<stdio.h>
void main()
{
int gd=DETECT,gm,maxx,maxy,midx,midy;
//load driver
initgraph(&gd,&gm,"c:\\tc\\bgi");
cleardevice();
maxx=getmaxx();
maxy=getmaxy();
midx=maxx/2;
midy=maxy/2;
line(0,midy,midx,maxy);
line(midx,0,midx,maxy);
getch();
closegraph();
}
- graphics program in c to draw a moving car
- c graphics program for animation
- graphics programming in c with output
- graphics programming in c examples
- simple graphics program in c to draw a line
- c program to draw a square using graphics
- graphics programming in c pdf
- c program to draw a rectangle using graphics
Strassen's Method For Matrix Multiplication c program
strassen matrix multiplication code in c
strassen matrix multiplication 4 4 example
strassen matrix multiplication for 4x4
strassen's matrix multiplication program in c using recursion
strassen's matrix multiplication for nxn matrix in c
strassen's matrix multiplication program in c using divide and conquer
strassen's matrix multiplication algorithm implementation
strassen's matrix multiplication for 4x4 matrix example in c
Strassen's Method For Matrix Multiplication c program
#include<stdio.h>
void main(){
int a[2][2],b[2][2],c[2][2],i,j;
int m1,m2,m3,m4,m5,m6,m7;
printf("Enter the 4 elements of first matrix: ");
for(i=0;i<2;i++)
for(j=0;j<2;j++)
scanf("%d",&a[i][j]);
printf("Enter the 4 elements of second matrix: ");
for(i=0;i<2;i++)
for(j=0;j<2;j++)
scanf("%d",&b[i][j]);
printf("\nThe first matrix is\n");
for(i=0;i<2;i++){
printf("\n");
for(j=0;j<2;j++)
printf("%d\t",a[i][j]);
}
printf("\nThe second matrix is\n");
for(i=0;i<2;i++){
printf("\n");
for(j=0;j<2;j++)
printf("%d\t",b[i][j]);
}
m1= (a[0][0] + a[1][1])*(b[0][0]+b[1][1]);
m2= (a[1][0]+a[1][1])*b[0][0];
m3= a[0][0]*(b[0][1]-b[1][1]);
m4= a[1][1]*(b[1][0]-b[0][0]);
m5= (a[0][0]+a[0][1])*b[1][1];
m6= (a[1][0]-a[0][0])*(b[0][0]+b[0][1]);
m7= (a[0][1]-a[1][1])*(b[1][0]+b[1][1]);
c[0][0]=m1+m4-m5+m7;
c[0][1]=m3+m5;
c[1][0]=m2+m4;
c[1][1]=m1-m2+m3+m6;
printf("\nAfter multiplication using \n");
for(i=0;i<2;i++){
printf("\n");
for(j=0;j<2;j++)
printf("%d\t",c[i][j]);
}
}
- strassen matrix multiplication code in c
- strassen matrix multiplication 4 4 example
- strassen matrix multiplication for 4x4
- strassen's matrix multiplication program in c using recursion
- strassen's matrix multiplication for nxn matrix in c
- strassen's matrix multiplication program in c using divide and conquer
- strassen's matrix multiplication algorithm implementation
- strassen's matrix multiplication for 4x4 matrix example in c
Tower Of Hanoi c program
tower of hanoi in c explanation
tower of hanoi in c without recursion
tower of hanoi in c using stack
tower of hanoi algorithm in data structure
tower of hanoi using stack
tower of hanoi in c++
tower of hanoi in c using iteration
tower of hanoi program in java
Tower Of Hanoi Using Backtracking in c++ program
#include<iostream.h>#include<conio.h>
void tower(int,char,char,char);
void main()
{
int n;
clrscr();
cout<<"enter the disk number : ";
cin>>n;tower(n,'A','C','B');
getch();
}
void tower(int n,char from,char to,char aux)
{
if(n==1)
{
cout<<endl<<"move 1 from peg "<<from<<" to "<<to;return;
}
tower(n-1,from,aux,to);
cout<<endl<<"move "<<n<<" from peg "<<from<<" to "<<to;
tower(n-1,aux,to,from);
}
Tower Of Hanoi c program
- tower of hanoi in c explanation
- tower of hanoi in c without recursion
- tower of hanoi in c using stack
- tower of hanoi algorithm in data structure
- tower of hanoi using stack
- tower of hanoi in c++
- tower of hanoi in c using iteration
- tower of hanoi program in java
Finite Automata String Matching Algorithm c program
finite automata string matching c code
automata c program
finite automata string matching algorithm example
string matching with finite automata java code
automata based programming examples
string matching with finite automata ppt
finite automata c++
amcat automata c questions
Finite Automata String Matching Algorithm c program
# include <iostream.h># include <conio.h>
# include <string.h>
class FiniteAtn
{
private:
char *T,*P,*sig;
int n,m,l,q,trans[15][15];
public :
void start(void);
void set_trans(void);
int tfunc(char);
void matcher(void);
int check(int,int);
};
void FiniteAtn :: start()
{
int i=0,j=0;
l=0; m=0; n=0; q=0;
cout<<"\n\n Enter the input text :";
cin>>T;
cout<<"\n\n Enter the pattern :";
cin>>P;
n=strlen(T);
m=strlen(P);
while (T[i]!='\0') {
for (j=0;j<l;j++)
{
if (T[i]==sig[j])
break;
}
if (j==l)
{
sig[l]=T[i];
l++;
}
i++;
}
sig[l]='\0';
for (i=0;i<15;i++)
{
for (j=0;j<15;j++)
{
trans[i][j]=0;
}
}
cout<<sig;
}
void FiniteAtn :: set_trans()
{
int i,j=0,k=0;
for (i=0;i<=m;i++)
{
while (sig[j]!='\0') {
(q+2)>(m+1)?k=m+1:k=q+2;
do
{
k--;
}
while (check(k,j));
j++;
}
}
}
int FiniteAtn:: check(int k,int u)
{
int i;
for (i=k;i>=0;i--)
{
}
}
int FiniteAtn :: tfunc(char a)
{
int i;
for (i=0;i<l;i++)
{
if (sig[i]==a)
break;
}
return(trans[q][i]);
}
void FiniteAtn :: matcher()
{
int i;
for (i=0;i<n;i++)
{
if (tfunc(T[i])==m)
cout<<"\n\n The string is found at shift s = "<<i;
}
}
void main()
{
FiniteAtn fa;
clrscr();
fa.start();
getch();
}
- finite automata string matching c code
- automata c program
- finite automata string matching algorithm example
- string matching with finite automata java code
- automata based programming examples
- string matching with finite automata ppt
- finite automata c++
- amcat automata c questions
draw arc c program
Draw arc c program
#include<conio.h>
#include<graphics.h>
#include<stdio.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm=0;
initgraph(&gd,&gm,"c:\\tc\\bgi");
// load graphics driver
arc(115, 118, 0, 150, 65);
/*
method used
arc(x,y,sa,ea,r);
sa=start angle
ea= end angle
r=radius of arc.
*/
getch();
closegraph();
}
draw arc c program, draw arc in c graphics program, draw arc in c program code, draw arc in c source code
Rabin karp String Matching Algorithm c program
implementation of rabin-karp algorithm in c program
Rabin karp String Matching Algorithm using c program
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<math.h>
#define d 10
void RabinKarpStringMatch(char *, char *, int);
int main()
{
char *Text, *Pattern;
int Number = 11; //Prime Number
clrscr();
printf("\nEnter Text String : ");
gets(Text);
printf("\nEnter Pattern String : ");
gets(Pattern);
RabinKarpStringMatch(Text,Pattern,Number);
return 0;
getch();
}
void RabinKarpStringMatch(char *Text, char *Pattern, int Number)
{
int M,N,h,P=0,T=0, TempT, TempP;
int i,j;
M = strlen(Pattern);
N = strlen(Text);
h = (int)pow(d,M-1) % Number;
for(i=0;i<M;i++) {
P = ((d*P) + ((int)Pattern[i])) % Number;
TempT = ((d*T) + ((int)Text[i]));
T = TempT % Number;
}
for(i=0;i<=N-M;i++) {
if(P==T) {
for(j=0;j<M;j++)
if(Text[i+j] != Pattern[j])
break;
if(j == M)
printf("\nPattern Found at Position : %d",i+1);
}
TempT =((d*(T - Text[i]*h)) + ((int)Text[i+M]));
T = TempT % Number;
if(T<0)
T=T+Number;
}
}
rabin karp algorithm example c program
rabin karp hash cprogram
Subscribe to:
Comments (Atom)
C Program example List
- C program to find longest word in given string
- C Programming solve assignment for IT students
- Write a function to find x rise to y using bit wise operators
- programs of C and Data Structures print day time date month year
- C Structure Programming Exam Question With Answer
- c program transpose of a matrix
- c understand algorithms and flow chart with examples
- C graphics program example to draw pie chart,graphics code in c
- dynamic memory allocation in c programming
- Explain Various Loop Control structures in c with example
- Explain various types of data type in C Language?
- c programs on file handling/Explain Random Access to file in C expain fseek( ) Function ftell ( ) Function with example
- C program example to calculate difference between two time periods using structure
- c program example to find largest word in a string
- c program to find leap year using ternary operator
- C program that find the sum of upper triangular el...
- C program to find the sum of following series
- Write a recursive function to find square root of ...
- How does Switch statement differ from Nested if
- indirection operator in C
- Differentiate between structure and union.
- Read string and output the frequency of each chara...
- accept word convert it into lowercase and display ...
- accept 5 string from user and display using pointe...
- C program matrix addition using dynamic memory al...
- implementation of dynamic matrix and calculate sum...
- print size of pointer variable and pointer values ...
- string append c programming
- find maximum number from two numbers by using poin...
- accept two string and remove common character in b...
- C program to find occurrence of the
- insert one string into the string at a given posit...
- calculate sum of all array element by using dynami...
- c program Perform matrix operation
- sum of first 50 number using goto c program
- check year is leap or not c program
- sum of n numbers c program
- copy first array into another array
- c program accept 10 numbers from user and copy odd...
- c program to display reverse array
- c cprogram all array operation,perform operation o...
- Accept student details with 5 subject using array...
- c program calculate bill for grocery shop
- c program to Accept any number from user and conve...
- c program to calculate series (1/1!)+(1/3!)+---+(1...
- c program to Accept number from user and display ...
- c program to print Display ASCII value of A-Z & a...
- c program to print series of 5n+2 but skip the mul...
- c program to print first 10 natural number square ...
- c program reverse of given number
- c program for print terms of series 3n+2 but stop ...
- c program for inter conversion of decimal,binary,o...
- c program print print 15 terms of fibonacci series...
- c program print prime divisor of given number
- c programs to display floyd's Triangle
- c program print first 15 number in reverse
- c program to find largest of three numbers
- c program to print dispaly first 15 natural number...
- c program for even number display first 10 even
- operator overloading c++ example
- c programming you must know
- What is Constant Variable and Keywords
- C Programming error miss mach prototype C Programming You must Know ?
- c program to read a set of names and arrange them in ascending order
- macro example in c-what is preprocessor in c
- C program using nested marcro
- c structure program to accept student information and print using pointer
- C Program To Calculate Simple Interest
- C program Accept an integer and find out multiply by 2 and division by 2 using bit wise operator
- C program example to find the sum of series
- C Program to display size,minimum & maximum capacity of int and float using , use of Limit.h header File in c
- C program to display data in different format, right alignment, left Alignment
- c absolute value float, absolute value in c language, abs in c programming
- c program for swapping two numbers using call by value
- c escape sequence characters
- c pattern programs of alphabets
- c program to find power of a number using recursion
- c program to sort array element
- C program to accept a number and check odd or even using bit wise operator
- c program to accept a string and insert at specific location of another string
- c program to perform all string operation without using library function using switch case
- C programming Pointer Basic
- C program to test whether character is uppercase o...
- C Program to convert a uppercase char to lowercase...
- C program to calculate salary with bonus amount.U...
- C program to swap two number using bit wise operat...
- C program To check number is even or odd and prim...
- C program Accept character and check for lowercase...
- C program to find bigger of two numbers using par...
- c Program of currency converter
- C program to calculate slope of line
- C program to accept seconds and convert it into h...
- C program to read days and convert it into year, ...
- C program to reverse 4 digit number, c program l...
- c program to Accept 4 digit number and calculate a...
- C program to Accept distance in kilometer and conv...
- c program to swap the value of two numbers using m...
- c program example micro with argument
- C Program to calculate square of number using macr...
- C Program for swapping two numbers without using t...
- C Program for swapping two numbers
- C program to calculate sum and average of five num...
- C program to calculate percentage of student accep...
- C program to calculate square and cube of a given ...
- C program to Calculate gross salary of a employee
- C program to calculate volume of a cylinder
- C Program to convert the given temperature in to c...
- This C Program finds the areas of different geomet...
- What is Floating point arithmetic
- what is Mixed mode arithmetic
- operator in c
- c storage classes,
- c code for prime number,c program to find prime factors of a number using function
- bitwise programs in c,bitwise operator program in c,bitwise programming in c
- c program for file operations
- Explain Array in c, its type how to use array with function and pointers
- Command Line Argument Program With Example
- Explain Union in c differece between unionand arry
- Explain RECURSION with example
- for loop examples in c, What are the control structures in C? Give an example each.
- relational/conditional operator/ternary operator in c example
- c program pattern example
- C Program example to count the number of vowels in given string
- C Program to display Fibonacci series
- c program example to extract sub string from given string
- c Program example reverse the string without using library function.
- What are escape sequences explain with examples
- actual and formal parameters of the function?
- Distinguish between malloc() and calloc(), break and continue
- c program example to find GCD of a number using recursion
- C program to compares two binary files, printing the first byte position where they differ
- What is bit field operator? Explain with example
- C program example to compares two binary file
- Type def in c program example
- c structure program example accept structure element and print using function
- c structure program example with micro
- C structure program example to find topper student
- C program example accept and print array element
- Write C program example to find length of Given String
- C program example swapping of two numbers
- C program example to pass array to the function
- C Program Pattern Examples with source code.
- C Program example to reverse each world of given sentence
- C program example to make string revere using recursive function,
- C program example to compare two string without using library function
- C program example Diagonal sum of matrix
- C Programming Practical assignment list
- simple c program example with explanation
- c program example to perform all string operation using pointers
- c structure program to perform account operation deposit , withdraw check balance
- c program to count the number of vowels in a given string
- c program to check vowels and consonant in a given string using switch case
- write a c program to check number is r even or odd,Armstrong no,prime no using switch case
- c matrix multiplication
- C program to Reverse Each Word of Given String
- c program to find x raised to y ,c program to find...
- C program to reverse the array element
- C program using function to print reverse the numb...
- C program to search element in array and display ...
- c program to print pascal triangle with source cod...
- c program to check string palindrome or not
- C program to find largest of two number
- c program to find largest and smallest element of ...
- c file handling programs to count number of lines ...
- c file handling programs to count number of lines
- C program to accept a string and convert it in to ...
- C simple program of matrix multiplication
- c program to accept a number and convert it in to ...
- c program to find the occurrence of the in given s...
- write c program to print string in descending and ...
- write c file handling program to copy file using u...
- c program file handling program to count no of spa...
- c program to find smallest element in an array usi...
- write a c program to find the sum of digits of a n...
- c program to print fibonacci series using recursio...
- Define storage classes in c ?
- What is mean by Type Casting in c programming
