18,490 Topics

Member Avatar for
Member Avatar for mindbender

I have to create a random matrix m*n where m and n are user inputs. Now i have to fill the matrix with random nos. Finally I must have a matrix where each value is either 0 , 1 , a fraction no between 0 and 1, and also sum …

Member Avatar for Nick Evan
1
5K
Member Avatar for Tunernetwork

I was told to ask my question here, so bare with me as I am new here! C+ code and vbulletin question I hope this is the appropiate place if not I apologize now and move if need be. I need help on this. I am workin on a site …

Member Avatar for sknake
0
154
Member Avatar for Monina

i have to sort an array of integers using bucket sort. i kind of made it but there is still a problem. before i make the sort i have to verify if there is one or many numbers which begins with one or many zeros.if there are this kind of …

Member Avatar for Monina
0
125
Member Avatar for phil750

Say i have an [code] int c =8; [/code] and i want to do a fork to say do a printf [code] printf("hello im number blah blah"); [/code] is there a way to do that printf as many times as whatever c is equal too? using a fork(). maybe something …

Member Avatar for gerard4143
0
106
Member Avatar for ankur_

In Suse I have got 2 libs which I have to use to link with my source files but they are interdependent on each other. Means if the 2 libs are A and B than A is dependent on B and B is dependent on A In that case what …

Member Avatar for Salem
0
169
Member Avatar for vegaseat

Convert a decimal (denary) integer to a binary string. An exercise in do ... while and while loops.

Member Avatar for arun26
2
2K
Member Avatar for ahmed supari

i am a beginner to the c language recently i`ve come across the expression - *s++ == *t++ what does this expression means??

Member Avatar for Narue
0
191
Member Avatar for piyushsol

in this code i did matrix multiplication 1. it accepts size of the matrix 1 . 2 . i used functions for enter matrix from user and print it. problem is that....it is printing garbage elements...[code]#include<stdio.h> #include<conio.h> void mx_enter(long int **arg,long int a,long int b) { long int i,j; arg=(int …

Member Avatar for kvprajapati
-4
97
Member Avatar for BoB3R

Hello, I've got problem with loop for and EOF in it. I want to write every thing from a file on screen it work with one line but i want to read all lines here is the code: [CODE]#include<stdio.h> #include<stdlib.h> #include<string.h> int main () { int i,j,k,l,o,liczba,tab1[4]; FILE *f = …

Member Avatar for kvprajapati
0
186
Member Avatar for hnf1991

I want to make a program that only takes integer. and if someone write any alphabet, then it will ask again for that number. For Example: Enter Age:as Invalid Number Enter Age:

Member Avatar for Dave Sinkula
0
99
Member Avatar for Donnovan

hey guys, i'm trying to acces the the member of my person structure, can someone help me, what am i doing wrong are what am i forgetting [CODE]#include <stdio.h> #include <stdlib.h> typedef struct { char *vnaam; char *anaam; int leeftijd; } persoon; persoon *q, p1; //char antwoord2b[128]; void drukaf(persoon p){ …

Member Avatar for Donnovan
0
128
Member Avatar for DIPY

Hi, I want to do something like this. I have a file File.c File.c # include <stdio.h> -------------------------->here struct B and its parameters should be inserted when i get it on next iteration. typedef Struct { B b1; --->this struct i will get on next iteration. }A; I am writing …

Member Avatar for sknake
0
160
Member Avatar for balajisankar

[CODE]#include<stdio.h> #include<conio.h> void main() {int a[10],i=0,c=0,n; printf("\n enter the gray code"); scanf("%d",&n); while(n!=0) {a[i]=n%10; n/=10; i++; c++; } for(i=c-1;i>=0;i--) { if(a[i]==1) { if(a[i-1]==1) a[i-1]=0; else a[i-1]=1; } } printf("\n the binary code is"); for(i=c-1;i>=0;i--) printf("%d",a[i]); getch(); }[/CODE] this is for converting binary code to gray code[CODE]#include<stdio.h> #include<conio.h> void main() {int …

Member Avatar for WaltP
-3
132
Member Avatar for Creator00

Hello, I need to write the recursive algorithm of type divide and conquer. The input is integer array S. The output is true if the array is sorted or false if not. Algorithm should divide the array in two halves, then to check the sorting of both halves with the …

Member Avatar for xavier666
0
63
Member Avatar for imolorhe
Member Avatar for isrinc

Newbie with problem reading 6-column floating point data. I copied an example and expanded for my use, but get this output in OutFileOne.txt: 0.000 0.000 0.00 0.000 0.000 0.00 Not getting correct values, nor correct # of values in columns. Any suggestions? Have tried explicit format (%5.2f) with no luck. …

Member Avatar for isrinc
0
1K
Member Avatar for mapla

[code] #include <stdio.h> main() { int number; int ch; char sh[100]; int i=0,j=0; printf("input No in Hex: "); scanf("%s",&sh); number = 0; i =strlen(sh); j=0; while(i!=0) { ch = sh[j]; printf("Ch:%d\t%d\t%d\n",ch,'7',ch-'7'); if(('0' <= ch && ch <= '9')) { number = number * 16; printf("Number :%d\n",number); number = number + …

Member Avatar for prushik
-2
170
Member Avatar for deepin

[code=c] while(1){//return from the loop only when the input is zero printf("\n1: Stack1\n2: Stack2\n0: to return\n"); scanf("%d",&i); switch(i){ case 1: printf("1"); break; case 2: printf(" 2"); break; case 0: printf("Thank you for using the service"); break; default: printf("Give a Valid Option"); break; }//end of switch - case }//end of while …

Member Avatar for WaltP
0
3K
Member Avatar for phil750

So i have to build a scheduler in priority ques, which will read infomation from test files. Also the work out the wait time and finish time. Text file will be like this; process1 21 3 process2 23 1 process3 45 20 [processID][space][Quantum][space][priority] So here what i have so far, …

Member Avatar for phil750
0
120
Member Avatar for prushik

I am trying to write a TFTP server. I have successfully completed the code, it is fully RFC 1350 compliant. However, I wrote the whole thing in Haiku OS, and in Haiku, it works great. However, I also need a DHCP server, and I don't have one for Haiku. So …

Member Avatar for prushik
0
258
Member Avatar for Member #129437

Hi, Apologies if this has been covered already - I searched but couldn't find anything relevant. I am looking to learn both of these languages mainly because I am in a bit of a dilemma career-wise. To be as concise as possible (this aint no agony aunt page I hear …

Member Avatar for Narue
0
308
Member Avatar for Code4Fun

hello all, i`m from S-E europe from Romania, i`m 21 I know HTML, C and C++ hope to learn PHP and ASM in the near future.

Member Avatar for CJesusSaves
0
40
Member Avatar for sacredfaith

Warm greetings! My name is Avery White and I am absolutely in love with Jesus, and I'm working on making Him the center of my life! I'm a 23 year old "super senior" at Texas A&M University, and I'm majoring in Computer Engineering with minors in Mathematics and English. I'm …

Member Avatar for CJesusSaves
0
200
Member Avatar for johndoe444

Hi, I am implementing the linked list delete as: before delete: (delete a) ->(0x01:a)->(0x02:b)->(0x03:c)-> after delete: ->(0x01:b)->(0x03:c)-> ie instead of deleting a the content of next node is copied to current node and the next node is deleted. The code is as follows: [CODE]template<class type>void list_delete(struct _linked_list<type>** llist, type value) …

Member Avatar for johndoe444
0
136
Member Avatar for vaibhav2614

Hi everyone, I've been trying to code up a generic vector implementation in C, and the compiler has not been kind to me... Here is the struct I have defined in a file "vector.h." [CODE]typedef struct 72 { 73 int elemSize; 74 int logLength; 75 int allocLength; 76 int delta; …

Member Avatar for vaibhav2614
0
149
Member Avatar for 54uydf

Hey everybody :) I'm looking for a ready code in [B]Java or C[/B] for[U] Ford - Fulkerson algorithm[/U]. I need to program something very similar and I thought it'd be great if I wouldn't have to start from scratch since I'm not that good programer anyways.:-/ I couldn't find any …

Member Avatar for 54uydf
0
107
Member Avatar for saiprasad_v

i wanted to know the procedure to find out a cycle inside a single linked list...if the last node of the list points to an of the nodes(say, the middle node) in the list, then there exists a loop in the linked list...i wanted to know the procedure to find …

Member Avatar for Salem
0
58
Member Avatar for wazzer225

Hi, I was attempting to convert the following grammer into CNF S -> XY X -> aXb | e Y -> aY | a The Mark Scheme gives the following: S -> AX | AY | a X -> AK | AB Y -> AY | b A -> a …

0
69
Member Avatar for Member #492414

Hi i am doing C programming in netbeans and when i compile and run my program i get a message in the dos console that says i need to use the nodosfilewarning to disable the cygwin warning i am getting. I have attached a screenshot as it is a rather …

Member Avatar for Member #492414
0
154
Member Avatar for xavier666

The program generates a calendar for one year. The program only asks for the day on which 1st January falls from user. Notes : [LIST] [*]Compiler - Turbo C++ 4.5 [*]Leap year has been considered [*]The only reason for including [icode]conio.h[/icode] is because of [icode]clrscr()[/icode]. If somebody can give me …

Member Avatar for binkiwinki
-3
393
Member Avatar for kinvaras

First of all, hi to everyone. I need help with an assignment, need to translate this C code to assembly. im getting pretty desperate and thats why im turning to outside help... This code is suposed to calculate sqare roots of 16bit numbers, and is to be implemented on another …

Member Avatar for Salem
0
131
Member Avatar for phil750

I am currently writing a basic program scheduler (just started) which we have a text file with format of Process(id) (space) (quantum) (space) (priority). I am working on the first bit of the program actually reading in the text file and am trying to assigned the process ids, quantum and …

Member Avatar for phil750
0
144
Member Avatar for iamcreasy

Im trying to solve a ACM problem 10189, LINK: [url]http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1130[/url] It looks ok to me...but, online judge is showing wrong answer... can anyone help me to figure out the problem. [CODE]#include<stdio.h> int row = 1, column = 1,i=0, j=0, a=0, b=0; char array[100][100] = {0}; int change(int a, int b) …

Member Avatar for iamcreasy
0
220
Member Avatar for asm2hex

Hello, I have a quick question I want to ask. How can I copy the data from a allocated variable, so that when I free up the allocated variable the copied data isn't erased with it. Thanks, -A2H

Member Avatar for Narue
0
124
Member Avatar for xavier666

Suppose the user wants to input a string. The length of the string is unknown. I also don't want a character array of size 1000 or what so ever. I want the size of the character array increasing by 1 byte for every character entered. Here is a sample output …

Member Avatar for Narue
0
441
Member Avatar for tien113

[CODE]#include <stdio.h> int main(int argc, const char* argv[]) { int x; loopstart: printf("enter a value : "); scanf("%d", &x); getchar(); printf("value is %d\n", x); return 0; } [/CODE] can u help me, I want x return integer number (ASCII code) when enter a character... my code is not working... thanks...

Member Avatar for WaltP
0
153
Member Avatar for Simzz

Dear all, I have a problem with binding a server socket on a mac os x 10.5.8. The problem is that every time i try to bind the socket to the address it gives the following error "Address already in use". I know that it means there is another process …

Member Avatar for gerard4143
0
463
Member Avatar for titosd

Hello, I have a program that i need to input a sentences from file and do with them some thing. I inputed it by fgets fun, and saved them at array. Now i want to cut the every sentence to words, such is: these sentences: Hello world You need to …

Member Avatar for Dave Sinkula
0
109
Member Avatar for rigidboss

Hello All, I have a requirement as follows. I am writing a software to compute invoice . The program will get the user details and it will autogenerate a INVOICE NUMBER. So in order to auto generate the INVOICE NUMBER, i tried to use file concept. I save a integer …

Member Avatar for justice igwe
0
136
Member Avatar for imso

I started to program on C++ on converting 8bit binary to its decimal requested for my school project. But i have problem to proceed further as i am lost on what to add on next. Can someone help me to add on to my program to allow it to work.. …

Member Avatar for Dave Sinkula
0
242
Member Avatar for Shillz

how can we use a printf statement without a semicolon??? this was a question asked during an interview of a computer engineering student.

Member Avatar for Shillz
0
172
Member Avatar for ireimaima

Hi...there,,can anyone debugging my code.. this program intend to find the average and count how many numbers is positif and negatif from 10 numbers entered by user. My problem is when i run the program the result of average is correct but somehow on the result of negatif and positif …

Member Avatar for ireimaima
0
166
Member Avatar for sarah_laz

I have been asked to program a spellchecker in C for an assignment. I am quite new to C and programming in general, so I have decided to start by writing a program that does the following: [LIST] [*]Reads words into an array from a dictionary text file. [*]Reads words …

Member Avatar for sarah_laz
3
1K
Member Avatar for Gaiety

why we have an int type when we already have short and long ints because int means either short or long.

Member Avatar for Salem
0
172
Member Avatar for caroll

hi, please please give me exact explanation for the tilt symbol in c.... here i have paste the code and i m getting the output of 1... how it comes 1..?please explain me soon...[code]#include<stdio.h> main() { int m=1; ~~~m; printf("%x\n",m); }[/code]

Member Avatar for caroll
0
151
Member Avatar for surfer2009

i am new in c . i have made the code in C++.its working fine. the only problem i face i got error in printf statment. please tell me how can i change cout statement into printf [code] #include<iostream> #include<cmath> using namespace std; int main() { int x=0; for(int i=0;i<=6;i++) …

Member Avatar for Narue
0
104
Member Avatar for caroll

please send me tutorials to know about the operators////.. especially 1) ^,>>,$,~..etc...

Member Avatar for WaltP
-2
98
Member Avatar for surfer2009

i have just started c language and i have only study "while" and "for" "if else" please help me in this question using loops(without usuing arrays) write a program that prodeuce the following output: 0 0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 …

Member Avatar for gerard4143
0
125
Member Avatar for techevo

Hi all, I am having a problem printing out the elements of an array, using a for loop. when i try to print out each individual element, it prints out the last element repeatedly. ie will print the last element of the array, over and over again. if you could …

Member Avatar for Narue
0
111
Member Avatar for bhavnam66

program using nested loops in c programming language to generate following pattern zyxwvwxyz zyxwxyz zyxyz zyz z

Member Avatar for Salem
0
116

The End.