15,550 Topics

Member Avatar for
Member Avatar for deepak_1706

I came across these to statements and i am not sure how they are parsed and the output given is produced... [CODE] printf("%d",printf("%d %d",5,5)&printf("%d %d",7,7)); [/CODE] o/p : 5 5 7 7 3 [CODE] printf(" %d %d",printf("%d %d",7,7),printf("%d %d",5,5)); [/CODE] o/p : 5 5 7 7 3 3 Could some …

Member Avatar for hyperion
0
154
Member Avatar for j.shakthiyokesh

this is a program to enter the elements of a square matrix and find the smallest element from each row and subtract the minimum value from all the values in the respective rows.........take the input as the following values 999 54 48 92 24 54 999 32 61 35 48 …

Member Avatar for mfaisalm
-2
205
Member Avatar for bgriffith

I am having troubles getting my sort function to sort properly. As written below the code functions well, but organizes all sorts in descending order. If I flip the inequality to display in ascending order, the program more or less stops working. The print function will no longer work, as …

Member Avatar for group256
0
122
Member Avatar for abhii

i want the code for sorting tecqnics....plz let me find a simple code

Member Avatar for Ancient Dragon
0
216
Member Avatar for swapnaoe

Hi there, Here's a basic question from the basics of C. Woukd like to know the use of appending L or UL at the end of integer constant which is assigned to an unsigned int type variable. for eg: on a 32-bit machine unsigned int i; i= 543727232UL; what way …

Member Avatar for Adak
0
184
Member Avatar for swapnaoe

Hi there, [CODE] #include<stdio.h> main() { int i; i=1,2,3; printf("Value of i with assignment as i=1,2,3 is %d\n", i); i=(1,2),3; printf("Value of i with assignment as i=(1,2),3 is %d\n", i); i=1,(2,3); printf("Value of i with assignment as i=1,(2,3)is %d\n", i); i=(1,2,3); printf("Value of i with assignment as i=(1,2,3) is %d\n", …

Member Avatar for Ancient Dragon
0
84
Member Avatar for y9john

This is my first time posting or really doing anything here on daniweb. I have read a lot of other posts and you all are very knowledgeable and respectful. So if I don't do something that I need to as per the forum regulations let me know. I have a …

Member Avatar for y9john
0
663
Member Avatar for zhuangdeyouxian

[CODE]/*Task: Two ordered linklist contain number. eg.1->2->3-> and 2->3->5 **Print** union of them eg.1->2->3->5 ,remove duplication, can't change linklist Problem : 1. append() might need to be modified. 2. dnot't know how to use append() to complete the task. */ #include <stdio.h> #include <malloc.h> #include <string.h> #include <stdlib.h> typedef struct …

Member Avatar for Martin B
0
123
Member Avatar for lennyemp

Hi all buddies, I am the beginner for multithreading in C/C++. So, I copied some example from MSDN and tried to compile it as my first step. Currently I am using DEVC++ IDE. The error is like that: " [Linker error] undefined reference to `sprintf_s' ". Here is the program …

Member Avatar for Ancient Dragon
0
446
Member Avatar for Shaabangbang

Hello, i have a question about string manipulation, i am supposed to write a function that takes a character array and returns a void, so far so good, but its supposed to reverse the array as output, for example, if the input is "Hello" the output is "olleH", here is …

Member Avatar for rajnish.singh
0
237
Member Avatar for myk45

Hello. i wrote a program to do the following: [B]Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted. [/B] This is what i tried: [CODE] void trimString() { char s1[] = …

Member Avatar for myk45
0
176
Member Avatar for gaurav_13191

I have written the following code for converting infix to prefix.. [CODE] //Infix to prefix conversion #include<stdio.h> #include<conio.h> #include<string.h> #include<ctype.h> #define MAX 25 void initstack(struct stack *); void push(struct stack *,char); char pop(struct stack *); char *convert(struct stack *,char *); void show(struct stack); int priority(char); struct stack { char arr[MAX]; …

Member Avatar for Schol-R-LEA
0
238
Member Avatar for stevanity

Guyz please help me Ive got a practical exam tomorrow can anyone give a simple coding for implementing prims algorithm. It accepts the vertices and cost and gives out minimum spanning tree. Please guyz. It must be very simple. It need not be perfect. It need not work for all …

Member Avatar for Adak
0
685
Member Avatar for DrueY

Hellur! Can somebody explain how exactly a fast fourier transform is performed on a wave file? What's happening behind the scenes? I need to get a basic idea of how it works. Thanks in advance drue

Member Avatar for Adak
0
117
Member Avatar for Unidennn

Hi, im trying to finish up my assignment on tic tac toe game.. and my program keeps crashing, here are two functions where i think it crashes, probably the first one: [CODE] void tic_tac_toe_init (char *ttt[3][3]) { char i,j; int k=' '; for (i=0;i<3;i++) { for (j=0; j<3; j++) { …

Member Avatar for abhimanipal
0
122
Member Avatar for Alerwiali

Hi everyone ! i am being asked to write a code of Block'd game that is implemented in Nokia phones ..i really dont know what to do as a beginning could any one help ?? Thanks alot .

Member Avatar for abhimanipal
0
78
Member Avatar for Pooch74

Hi! Having some problems with functions in this one. As ypu can see I'm a tottal beginner. What I'm trying to do here is make a program checking if a word is a palindrome. Using 2 functions, one to check and one to reverse the user input string. My problem …

Member Avatar for WaltP
0
131
Member Avatar for widapol
Member Avatar for widapol
0
80
Member Avatar for nonetheless

I am confused with the conversion limitations between the three: ints, floats and double. The question is whether the following operations give the same result or not (yield true or not). For instance we have an integer x: Would (Float)(x) == (float)(double)(x) I believe that should be true, as the …

Member Avatar for Ancient Dragon
0
141
Member Avatar for myk45

Hello. Well, for creating linked lists, i always use 2 pointers: one for beginning and one for the end of the list. Is this OK? Or am i required to have just a single pointer pointing to the beginning of the list and then traverse everytime i need to insert? …

Member Avatar for Schol-R-LEA
0
115
Member Avatar for j.shakthiyokesh

i am having problem in executing the following program.........when i execute it,it's getting hanged....pls gimme a gud solution [CODE]#include<stdio.h> main() { int n,x=0,y=1,z; printf("\nEnter a number of your choice:"); scanf("%d",&n); z=n; do { x=n%8; x=x+x*y; y=y*10; z=z/8; }while(z<8); printf("\nThe octal equivalent of the number entered is %d",x); }[/CODE]

Member Avatar for myk45
0
79
Member Avatar for trebor09

[code]#include <stdio.h> #define p printf #define s scanf int program,Y,N; do { p("Choose from the following program\n"); p("1 for program no.1"); p("2 for program no.2"); p("3 for program no.3"); p("4 for program no.4"); p("Continue (Y or N)?"); repeat = getchar(); putchar('\n'); }while(repeat == 'Y' || repeat == 'N'); } program1() …

Member Avatar for roottybrian
0
239
Member Avatar for devesh2222

how can i write code in c that the two programs are run one after another whithout the use of threads.

Member Avatar for myk45
0
81
Member Avatar for devesh2222
Member Avatar for myk45

Hello. i was trying to solve this problem. [B]Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it.[/B] Well, what i did is, use an array called present, to flag the elements ie: [CODE] for (i = …

Member Avatar for myk45
0
96
Member Avatar for 9tontruck

Hi, I have some questions about multi pipe. First of all, What I should do is making 6 child processes and each of child process reduces a global value (by 1) which is saved in malloc concurrently until the value reaches 0. All I could find from google was about …

Member Avatar for gerard4143
0
182
Member Avatar for rje7

[code=c] printf("\nn = %*d", 5, 4); [/code] and the output is: [code]n = 4[/code] (yea! there are spaces between = and 4) if i am providing only one argument 5 instead of 5 and 4 i get an error stating too few arguments. What in the world is the "*" …

Member Avatar for rje7
0
190
Member Avatar for trebor09

#include <stdio.h> #define p printf #define s scanf int program,Y,N; do { p("Choose from the following program\n"); p("1 for program no.1"); p("2 for program no.2"); p("3 for program no.3"); p("4 for program no.4"); p("Continue (Y or N)?"); repeat = getchar(); putchar('\n'); }while(repeat == 'Y' || repeat == 'N'); } program1() …

Member Avatar for trebor09
0
241
Member Avatar for Goshutu

Hi,I have tried to get this program to work,but it works to the moment when you enter some of the array`s numbers and then crashes.In different sizes of the matrix you can enter different number of numbers,but for instance when the matrix is 5x5 the program crashes after the 11th …

Member Avatar for Goshutu
0
447
Member Avatar for onus

I am making a program to do a breadth first search. The code which I am posting here just makes a que of the nodes visited in a binary tree in inorder fashion,so this implementation is not yet complete. While developing I got a segmentation fault which I was not …

Member Avatar for Martin B
0
158

The End.