15,552 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
Convert a decimal (denary) integer to a binary string. An exercise in do ... while and while loops. | |
i am a beginner to the c language recently i`ve come across the expression - *s++ == *t++ what does this expression means?? | |
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 … | |
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 = … | |
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: | |
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){ … | |
[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 … | |
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 … | |
Please, I need help in finding the sum of two matrices using pointers. Thanks. | |
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. … | |
[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 + … | |
[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 … | |
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, … | |
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 … | |
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) … | |
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; … | |
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 … | |
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 … | |
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 … | |
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) … | |
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 | |
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 … | |
[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... | |
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 … | |
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 … | |
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 … |
The End.