15,551 Topics
| |
#include <stdio.h> void function1(void); void main () function1(); } void function1(void) { int a; int b; int c; int d; int i=0; int rooms; printf("enter number of rooms\n"); scanf("%d",&rooms); do { printf("Enter the price per meter of the tiles\n"); scanf("%d",&a); printf("Enter the length\n"); scanf("%d",&b); printf("Enter the breath\n"); scanf("%d",&c); printf("Enter the … | |
#include <stdio.h> #include <stdlib.h> #include <string.h> FILE *data; struct node* L = NULL; struct nodeMail* M = NULL; struct nodeNr* N = NULL; struct nodeMail { char email[20]; nodeMail* next; }; struct nodeNr { char numri[10]; nodeNr* next; }; struct node { char emri[10], mbiemri[10]; nodeMail* email=NULL; nodeNr* numri=NULL; int … | |
#include <stdio.h> void Merge(int *, int, int, int); void MergeSort(int *array, int left, int right) { int mid = (left + right) / 2; if (left < right) { MergeSort(array, left, mid); MergeSort(array, mid + 1, right); Merge(array, left, mid, right); } } void Merge(int *array, int left, int mid, … | |
Friends i have little bit problem in making a c language program. I have to make a program which prints prime numbers from 1 to 500. I make this program but with while loop then i was told to make it using for loop, which i tried but failed. So … | |
The program should insert a node that is a sum of next 2 nodes stdin: 2->7->4->9; stdout: 2->11->7->13->4->9; The program returns a segmentation fault,I'm not sure what seems to be the problem. void insert(Node * list){ if (list==NULL) { return; } for(; (list->next->next)!=NULL ; list=list->next){ Node* new=(Node*)malloc(sizeof(Node)); if(new == NULL) … | |
Is it possible to dynamically use scanf to prompt for user input ? I have the code shown below scanf("%d %d %d %d", &myarray[row][0], &myarray[row][1], &myarray[row][2], &myarray[row][3]) which works fine when the number of columns is fixed but in my case it is not ! | |
This Project is to implement some procedures doing the following: 1. Represent any graph using these input parameters: • A parameter to represent the graph by Adjacency Matrix, or Adjacency List. • A parameter to indicate whether the graph is directed, or undirected. • A parameter to indicate whether the … | |
how can you write a program that returns the last integer of the inputted number from the keyboard by the user using recursion? | |
I have a small code utilizing a hash table. Now I want to convert it, basically, to a distributed hash table. Hoever, I can not find out how you actually code one or what changes you make to an existing hash table...??? Can anyone please help me, please? I can … | |
Hi i'm a newbie here & my questions are : 0- *what should i know to develop a library like the C standard library and if im thinking of building my own OS "im just dreaming" should i create a NEw C for it cause as we know C for … | |
Okay. This weeks 'problem' is that I need to simulate a game. I have to make two singly linked lists which will contain a name of player, his attack (double/float) number and his defence number and so on for as many players as the user inputs. The point of the … | |
This is my function UpdateWord. It searches for a word in the file and updates the word or the meaning void UpdateWord(void) { char srchWrd[30],choice,qtn='Y'; int x,y; dictio a, temp; FILE*ptr; do { printf("\nEnter Word to update: "); fflush(stdin); gets(srchWrd); x=strlen(srchWrd); for(y=0;y<x;y++) srchWrd[x] = tolower(srchWrd[x]); if((srchWrd[0]>='a')&&(srchWrd[0]<='i')) ptr=fopen("A-I.dat","r+b"); else if((srchWrd[0]>'i')&&(srchWrd[0]<'s')) ptr=fopen("J-R.dat","r+b"); … | |
Hello all!Im trying to write a program that accepts a string from users and then converts each character in the string to its corresponding 8-bit binary code and store it for further manipulation on obtained bit. I have the following code but it is not executing as expected : #include … | |
help with this PROGRAMM: Topic :The book of contacts Build a programm in C ,which saves in a text document the list of contacts /persons. Every contact should save an information for: 1.Name 2.Surname 3.the list of email(he can have a few addresses) 4.the list of the number of phones. … | |
It's a server-client code. The client should wait for the server, and if there's no response, then send a new request. There's a 2 second wait. It's UNIX. I've been looking at some select() examples, but I'm not really sure... I found this example. #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> … | |
when we create child controls, what is the style for accept text formats? (i mean: '\t', '\n' and others) | |
I'm currently writing a program that can track each word appear in a paragraph. For example, if a paragraph is "I have two dogs and two cats......" my program output should be: 'I'appeared 1 time, 'have' appeared 1 time, 'two' appear 2 times ....so on So far, I have two … | |
how to program that allow user to search, delete existing data, insert new data, sort the data and display the data | |
What is the maximum buffer size allowed in memecpy() function in c, I am using GCC compiler,32-bit system, What is the affecting factor for memcpy failure? ->Alignment issue? ->Size? however the buffer size 256bytes not working, tried 160 bytes copy which fits our requirement | |
I get this error poping up here and there but I still don't know what it means and how to fix it. "Windows has triggered a breakpoint in program_name.exe. This may be due to a corruption of the heap, which indicates a bug in program_name.exe or any of the DLLs … | |
when i use the ownerdraw message, with button(for exemple), do i lose the button face or only the text? (i need show a text and image, without lose the button face) | |
hello, i am really new in C programming. This is regarding switch case. How do i limit user input in switch cases? In this case, after they input 1 or 2, i dont want them to input any other number other than 0. Im still new in loop so any … | |
If I want to have a datagram socket, what do I have to change here ? It's a stream socket right now. Just change it where it creates the socket ? `sockfd = socket(PF_INET,SOCK_STREAM,0);` | |
So i just finished my first c course, so what comes after? like i learnt how to sort arrays, import from files and change them, linked list and stacks and queues, so thats it? can't wait for the new semster to learn more, i just wanted a heads up to … | |
i want a program code that convert the decimal to binary numbers and vise versa, and a GUI that contain my name which is: "Hafenaaje" and my student number="120012189. the gui may contain clear, decimal, binary and exit button... please help!!!! | |
Am developing a c programming which contains windows.h header file and GetWindowText api functions.Now i want to run it in linux.Is there is any api in linux or is there is any possiblity to run the c programming on linux. | |
Hello everyone, I was given this assignment, but I am stuck. Your help is appreciated :) 1.Ask for a desired accuracy epsilon for the to approximate value of \pi. 2. Use the Leibniz series to approximate pi. 3.Check after each iteration step wether the value of the last summand | … | |
Hi, My task is to create a library/precompiled header for use with MASM. I am using Code:Blocks. I have googled quite a bit and haven't come up with an appropriate solution. I was hoping someone could point me in the right direction. This is what i have done so far: … | |
I have some experience with client-server codes. TCP and udp client. I want to know how a stream socket works with HTTP. This client is for a server-client code where the greatest common divisor is calculated and displayed. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> … |
The End.