15,552 Topics
| |
[CODE]#include<stdio.h> #include<conio.h> ins(int tree[15],int n,int item) {int ptr,par=0; printf("\nitem here is%d \t\n",item); n=n+1; ptr=n; while(ptr>1) {par=ptr/2; if(item<=tree[par]) {tree[ptr]=item;return;} tree[ptr]=tree[par]; ptr=par; } tree[1]=item; return; } del(int tree[15] ,int n,int item) {int last,right,left,ptr=0; item=tree[1]; last=tree[n]; ptr=1;left=2;right=3; while(right<=n) { if(last>=tree[ptr]) { tree[ptr]=last; return; } if(tree[right]<=tree[left]) { tree[ptr]=tree[left];ptr=left;} else{tree[ptr]=tree[right];ptr=right;} left=2*ptr;right=left+1; } if(left==n&&last<tree[left]) {ptr=left; } … | |
hello everyone, i an new in daniweb and i want to know that how to generate random numbers in c without using pre-defined functions........... i can not use any predifined function...........it should b totaly our logic to generate random numbers........... please help me out........... i dont know c.........although i know … | |
How to create a simple password accepter program in C language | |
[CODE] #include<stdio.h> #include<stdlib.h> typedef struct a { int data; struct a* next; }node; void addatbeg(); void delete(); void display(); node *first=NULL; int main() { int ch; while(1) { printf("\n1:to add elements \n2:to delete elements\n 3:to display elements"); scanf("%d",&ch); switch(ch) { case 1:addatbeg(); break; case 2:delete(); break; case 3:display(); break; default:printf("\n … | |
It compiles and run but I'm stuck on the last part - I can't figure out how to iterate through the LinkedList and delete all students whose birthYear is greater than 1995 (print only students whose birthYear is less than 1995). I have to iterate after inserting all records into … | |
fscanf returns EOF in case of [U]errors[/U] or if it reaches eof. what does error mean in this context ...which type of errors are encountered??? | |
[CODE]//SOME BODY PLEASE WRITE THIS IN C++ LANGUAGE// //THANK YOU// # include<stdio.h> # include<conio.h> /*program to evaluate the given postfix expression*/ typedef struct { int a[100]; int top; } STACK; void push(STACK *s,int x) { if(s->top==99) printf("STACK OVERFLOW\n"); else s->a[++s->top]=x; } int pop(STACK *s) { int x; if(s->top<0) printf("STACK UNDERFLOW\n"); … | |
[CODE]#include<stdio.h> int main(){ int a=5,b=10; a=a+b-(b=a); printf("\na= %d b= %d",a,b); getch(); }[/CODE] | |
hello, i have tired to sort my link list but unfortunately i can't seem to get it working. The problem i having with the sort function is that it will sort the function when i enter a member to the list at the end except for the head. Also when … | |
Hey guys, I need some help regarding a project involving dictionary based language translation. So what I have to do is, given a text in a foreign language (like Hindi), my program should match each word from a 'dictionary like file' and give the output in English, I don't have … | |
Hi there i have a txt file containing these variables anil just_go_with_it 5 betty the_dark_knight 3 anil source_code 3 carrie just_go_with_it -3 anil paranormal_activity -5 doug the_dark_knight 5 betty shawshank_redemption 5 carrie source_code 1 betty paranormal_activity 5 carrie shawshank_redemption 5 doug shawshank_redemption 3 what im trying to do is to … | |
The problem I need to solve is Write a program using fork() to compute average of N numbers. The parent process forks a child process that takes input from the user, adds all the numbers and returns the sum and the count of numbers to the parent process that divides … | |
Make a program which takes in a whole number in the range 0 – 2147483647 and output the binary bit pattern for each of the following case: 1. 32 bits: if the input number is stored as int. 2. 32 bits: if the input number is stored as float. 3. … | |
Running: Windows 7 Home Premium. I am not sure if I am posting this in the correct board, so please move this if I am incorrect in my post placement. I am trying to set Allegro up, for programming a 2D game in C (which is why I chose this … | |
actually in gcc compiler of linux everything is working fine without header files... Then what is the real use of the header files in c & c++ langs ?? can anyone ans it?? | |
[CODE] #include<stdio.h> #include<conio.h> void hello() { printf("\nHELLO\n"); } int main() { hello(); hello(); hello(); hello(); getch(); return 0; } [/CODE] If I run this code on a compiler,how many processes and how many threads will be running on the compiler and which ones? Does a duplicate function call consist another … | |
In structure hen i read floating point value from user and i get the error like"floating point not conneted..." i have been sugested to write two lines for that extern void float conetor(); #pragma extref floatconnector even though i got the same error it is not even asking for float … | |
please help me. my program is working but not displaying the table but i followed the syntax for the two-dimensional array. how come the program does not display the table? here is the code. :D [CODE] #include<stdio.h> #include<conio.h> main() { int x[5][5],a,j; for (a=0;a<=5;a++) for (j=0;j<5;j++) x[a][j]=(a*4)+j+1; for (a=0;a<=5;a++) for … | |
Hi, I have a bunch of hex constants I'd like to define with new names for characters for an LCD driver I'm writing. Can I just define them in hex in the header like this: #define NINE 0x39 Do I have to force #define statements into char like this? #define … | |
The problem I am trying to solve is Write a program using fork() to compute average of N numbers. The parent process forks a child process that takes input from the user, adds all the numbers and returns the sum and the count of numbers to the parent process that … | |
Hello everybody, I have never done anything with dynamic memory allocation and was trying to allocate enough memory to hold four elements of an array. Each of these elements will hold another array that will hold the actual data. My questions is how can I check the size of a … | |
how does the size of int ,float ,pointer varies according to 32 and 64 bit processors? can anyone explain it clearly? | |
[CODE]printf("\n How much you tickets you want to bet(Rs20 per ticket): "); scanf("%i",&bet); int x=0; for (x=0;x<bet;x++) { printf("\n Enter the 6 numbers ( 1 - 40): "); // int num/*concatenate x */[100] for( i=0;i<6;i++) scanf("%d",&num/*concatenate x */[i]); // Storing the values inserted into array num }[/CODE] Suppose i got … | |
I'm looking for some projects to follow and learn in C; it really helps in developing my skill. Thanks in advance. | |
Hi, I have a working C source code for implementing writing of alphanumeric characters from a 3x4 keypad, similar to a normal cell phone 3x4 keypad. However, when I want to store the characters that have been typed from the keypad as a string, the characters that are on the … | |
I think something is wrong with my Flames project.. please help me the wrong might have been the counting.. example Rizal maria I crossed out the similar letter and it came out that it had only three letters that are not similar so in F L A M E S … | |
[CODE]#include.. int x,y,x1,x2,y1,y2; int midpoint (int x, int y) { x=2(x1+x2); y=2(y1+y2); } void main() { clrscr(); printf("enter 4 points"); scanf("%d %d %d %d",&x1,&x2,&y1,&y2); midpoint(x,y); printf("the midpoint is %d %d",x,y); getch(); } [/CODE] i cant run my program i think there's a problem in the function midpoint but i cant … | |
[B]i have written one programm in c using structure to enter name and account number of the emplpyee.the programm shows an error which is filename.c:11 error:expected identifier or "("before"["token..i am not able to get the error...please clearify it.[/B][CODE] #include<stdio.h> #include<conio.h> #include<stdlib.h> main() { struct wipro { char name[20]; char accnum[10]; … | |
hi The question to which am using the for loop is as follows: Write a C interactive program that will encode a word or sentence entered by a user. The encryption will be done as follows: For any word or sentence (note: blank spaces, special characters are ignored here, i.e … | |
im creating a cartesian plane i will plot the points but how am i supposed to determine if the points create a single straight line ? tnx |
The End.