15,551 Topics

Member Avatar for
Member Avatar for Nikhar

While it is true that the inorder traversal of a binary search tree produces a sorted output, is the converse also true, i.e., if the inorder traversal of a binary tree is sorted, then is it necessarily a binary search tree?

Member Avatar for deceptikon
0
107
Member Avatar for eranga246

[CODE]#include<stdio.h> #include<conio.h> void main(){ char x; int result,a,b; printf("type the first number\n"); scanf("%d",&a); printf("enter the operand\n"); scanf("%d",&x); printf("type the second number\n"); scanf("%d",&b); switch(x){ case '+': result=a+b; printf("value is:%d",result); break; case '-': result=a-b; printf("value is:%d",result); break; case '*': result=a*b; printf("value is:%d",result); break; case '/': result=a/b; printf("value is:%d",result); break; case '%': result=a%b; …

Member Avatar for deceptikon
0
106
Member Avatar for jdm

I'm writing a tcp server and client program in C on linux. It compiles and works under linux, but when I try to compile it using terminal under mac I get errors. If somebody knows why I would appreciate telling me. Any way I have most of the program done, …

Member Avatar for savoie
0
216
Member Avatar for kahheng93

This is my code: it works,but when the user answers correctly until question 7,the question 8, 9 , 10 will be skipped and goes to result instantly,can someone tell me whats wrong?i been looking it trhough for hours >.< thanks [CODE]void hangman (void) { int wrong =0; int answer; char …

Member Avatar for Ab000dy_85
0
125
Member Avatar for kahheng93

hi guys,im trying to create a menu which allow user to select their choice. When a choice is selected, a function designed for that choice will be called. However,it seems that i cant use 'if else' to call them, is there anyway to solve it?im sure i did it wrongly...if …

Member Avatar for kahheng93
0
161
Member Avatar for tubby123

Hey, I have a problem taking input from the terminal. I need to read an integer first, then a string. But when I press enter after entering the integer, the string doesn't take any input. Yes, I did try using a fflush(stdin) between the 2 inputs, still doesn't work. I …

Member Avatar for tubby123
0
144
Member Avatar for linezero

[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> //typedef struct to define what's in the phonebook typedef struct PhoneBookContacts { char Name[20]; char Surname[20]; char PhoneNumber[20]; } phone; //Function prototypes void AddEntry (phone[]); void DeleteEntry (phone[]); void PrintEntry (phone[]); void Sort (phone[]); int counter = 0; //Global counter variable used to keep …

Member Avatar for savoie
1
23K
Member Avatar for doublebond

Hi Guys, I have an issue with my program. I am trying to implement bitonic sort parallel algorithm using MPI. The issue is like i am able to sort upto 1000000 array elements.. but, if i increase it to 10000000 or 100000000 the processors are not able to handle it. …

Member Avatar for giomal
0
1K
Member Avatar for rutwvu

I am currently working on implementing an operating system in turbo c which uses c as the programming language. For this project we must implement pagination. I have absolutely no idea how to do this in c and most web results are for web pages using mySQL or java or …

Member Avatar for rubberman
0
200
Member Avatar for whitech

I've to write a program which gets a colour from user.Users will enter the colour's name if the colours is exist in my string,program will give a msg.If it doesn't exist give an error msg and stop program.I've already write a code but it doesnt works accurately. [CODE]int i,j; void …

Member Avatar for Subhasis giri
0
121
Member Avatar for nonlinearly

Hi I have an old inherited file with c code (visual studio 6). I compiled this file in Visual C++ 2010 (I made an empty project and a win32 console application) and was OK. But when I did the build to make the .exe then the linker throws errors. I …

Member Avatar for nonlinearly
0
246
Member Avatar for Rashidindia

hello friends, I am reading multidimensional arrays but i am not getting understand. anyone know please help me in detail. thanks,

Member Avatar for tungnk1993
0
82
Member Avatar for kishor.R
Member Avatar for zeroliken
0
41
Member Avatar for Dec28

Alright guys, I've been trying to think how to do this and I keep confusing myself. It's part of a project using piping in UNIX but first I need to get this small program running properly. I want to pass the final result (Hex value) to another program that will …

Member Avatar for histrungalot
0
241
Member Avatar for Shishir S

Is it possible to open an text file of any .exe extension software and read those characters into an array :?:

Member Avatar for WaltP
0
45
Member Avatar for Esmerelda

[code] #include<stdio.h> main() { int a=1; switch(a) { case isdigit('1'):printf("Hello"); } }[/code] This code works fine Hello is printed [code] #include<stdio.h> main() { int a=1; switch(a) { case isalpha('a'):printf("Hello"); } }[/code] But this code gives an error It says case label does not reduce to an integer

Member Avatar for WaltP
0
125
Member Avatar for shaffatshah

hello everybody [CODE]void func1(){ // do something //exit the function if some error occurs (like segmentation fault) but continue running the rest of the program } void func2(){ //do something //exit the function if some error occurs (like segmentation fault) but continue running the rest of the program } int …

Member Avatar for deceptikon
0
160
Member Avatar for student_learner
Member Avatar for SDDMV

[CODE]#include <stdio.h> #include <stdlib.h> int add(int i, int j , int k) { while ( i != 0) { j = i % 10; k = k * j; i = i / 10; } return k; } int main () { int num, num2=1, r; int ret=1; int i=0; …

Member Avatar for MonsieurPointer
0
126
Member Avatar for emmasmart
Member Avatar for Albion1

Can you help me for the following problem: Implementation of a program in C that solves the problem of competition between the four processes that share the source of the network card with the semaphore method

Member Avatar for Abhineet.Ayan
0
95
Member Avatar for Graphix

Hi, I've been trying to learn what pointers are and how they function, and I now finally understand most of it. However, I don't understand the assignment of strings to a char *, and what the values they have mean. I wrote a small program to learn: [CODE]#include <stdio.h> #include …

Member Avatar for Graphix
0
171
Member Avatar for cajohnson

I am working to take c code from an academic paper and edit. I am studying cryptographic algorithms. I have ran the following code, but I am having a little difficulty understanding two things. First, the program uses unsigned long ints. When they are added or subtracted, I don't get …

Member Avatar for cajohnson
0
210
Member Avatar for mBrissman

Hello! I have a problem. I can't use scanf() to set a value of the second member of the person struct. Why? I get an error that tells me "bad access". [CODE]int main(int argc, const char * argv[]) { struct Adress{ char *street; char *postal; int zip; }; struct Person{ …

Member Avatar for mBrissman
0
1K
Member Avatar for gourav1

[CODE]#include<stdio.h> //#include<conio.h> //#include<string.h> #include<string.h> //#include<iostream.h> int main() { char al[28],b[104]; int i=0; int t,k=0; // b[0]='A'; scanf("%d\n",&t); while(t--) { // scanf("%s",b); gets(b); gets(al); //gets(al); //printf("%s",b); //puts(al); // scanf("%s",al); // for(k=0;c1!='\n';k++) // { // scanf("%c",&c1); // // b[k]=c1; // cin>>c1; // b[k]=c1; // } // printf("hello"); // puts(b); // gets(b); // …

Member Avatar for deceptikon
0
236
Member Avatar for Sommy

Hello...just started learning C and i'm trying to write a program that solves quadratic equations...but every time i compile and run it and enter the 3 variables it crashes. I kept on looking but didn't find anything wrong with it...help? :P [CODE]#include <stdio.h> main(){ int a,b,c; float x1,x2; printf("Please enter …

Member Avatar for MonsieurPointer
0
207
Member Avatar for linezero

Hi Programmers, Please help me, i was wondering on how to create a simple phone book program using struct array to insert a new contact, update an existing contact, delete an existing contact and to display the contact information

Member Avatar for zeroliken
0
953
Member Avatar for qualt

I have a C-code written in turbo C. I want to make a standard exe file that can easily run on any other PC as well which doesn't have TC installed. I have to provide my client simply an exe file which continuously monitors the serial com port for some …

Member Avatar for qualt
0
342
Member Avatar for fr0st003

I read through all previous post regarding quicksort on a linked list. The trouble I am having is using a random element, it seems all the other post are using the first or middle element where I want to use a random element for the pivot. in anycase here is …

Member Avatar for fr0st003
0
646
Member Avatar for thache

I've been trying to figure out whats wrong here, but I just can't wrap my head around it. My compiler outputs the following when I attempt to compile it. [CODE] z:\Desktop\tmp\proj4>cl proj4_linkedlist.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. proj4_linkedlist.c …

Member Avatar for thache
0
340

The End.