15,552 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 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
108
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
78
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
143
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
169
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
90
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
168
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
84
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
110
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
119
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
56
Member Avatar for imolorhe
Member Avatar for xavier666
0
171
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
160
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
99
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
237
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
112
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
121
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
45
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
371
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
113
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
202
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
100
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
426
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
138
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
408
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
96
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
112

The End.