15,552 Topics
| |
Can anyone give me some ideas on how to find the middle value between 3 numbers.? I really dont know how to start... I know how find minimum and maximum but finding the Middle value is kinda hard for me... For those C Wizards give me some idea advice please?., … | |
How can my program search for strings that has " " enclosing it and compare it to another string? Thanks for helping me! | |
Hello, I am learning C by reading the second edition of "The C Programming Language" by K&R but am struggling to understand this bit of code on page 145: [code=c] struct nlist *np; if ((np = lookup(name)) == NULL){ np = (struct nlist *) malloc(sizeof(*np)); ..... } [/code] Lookup returns … | |
[code=c] #include<stdio.h> #define scanf "%s is char" main() { printf(scanf,scanf); } [/code] the output is %s is char is char y it is so.. | |
I have a problem referring to Geometric progression Using a few mathematics formula I have to compare the value En that I calculate using Sinfinite and Sn. This value En(which determines accuracy of the calculated number I believe) should than be compared to an arbitrary value E. When En becomes … | |
Hello everyone, I am currently in a C class and I am having trouble with the following exercise. I have started but I am stuck, can anyone help? You are developing a database of measured meteorological data for use in weather and climate research. Define a structure type measured_data_t (which … | |
Hi, Can anyone advise on how I can convert a string to a hex string? [B](And subsequently perform an AND operation on two hex strings.)[/B] I have a string value passed in (e.g., 1006), and I want to turn that into hex (0x1006). I have tried the following: [CODE] [B]// … | |
hello can you help me how can i print asterisk to form triangle like this [CODE] * *** ***** ******* [/CODE] here is my code [CODE] int main() { for(i=0;i<10;i++) for(j=0;j<i;j++) { printf("*"); } printf("\n"); getch() return 0; } [/CODE] please help me hoping for your positive responds...thank you in … | |
great masters, i am in desperate need of help. i have a text file like this: (employee.txt) john,a100,1 bob,a200,2 chris,a300,3 i need a very small program that when i enter an employee number(ex. "a200"), it will display the name and number on the same line. thanks. | |
Dear all, Why do i need to recompile the code? Where as the X86 the architecture is same?? The final instruction are also going to be same right??? I assume there must be some difference between windows and linux executable handling in the sense of program loading (loader) but can … | |
Hello, i was trying to generate a series as follows: 111 112 113 121 122 123 131 132 133 and this is what i tried: [CODE]#include <stdio.h> int A[3]; void func(int k) { static int level = -1; A[++level] = k; for(int j = 1; j <= 3; j++) { … | |
Hello again guys, I got here a Stack and Queue Array program. My problem is deleting an item in Queue. Here's a quick video of my problem: [url]http://www.youtube.com/watch?v=X_G82aU_LV4[/url] Here's my code: [code=C]#include <stdio.h> #include <conio.h> int main() { int a[100],n=0,i; int cho,choi,choice; clrscr(); do { printf("\n\n\n [1] Stack\n"); printf(" [2] … | |
please can any one say the number of iterations for all sorting methods ...that is for bubble sort,selection sort,insertion sort,quick sort ,merge sort,heapsort .... please reply soon.... | |
I am trying to write a function that calculates the sine of a given angle. The code works fine if the angle in degrees is less than 100...once the angle becomes greater than 100..the result is a large value. I don't know what I am doing wrong. Can someone point … | |
So I have opened a file with the "open" command and I get a file descriptor. That means I have to use lseek rather than fseek, which is fine by me. But what if I want to know how long the file is or what if I want to know … | |
what I want to do is I have two txt files named as number.txt and numAndName.txt In number file it contains only one character and it is a number. IN numAndName file it contains both number and Names as follows 5 name5 4 name4 3 name3 2 name2 1 name1 … | |
I had the problem to reverse the digits and I searched and found the answer, but I was wondering as to what is the fuction of the "%" I was playing with it when changing values of 10 to 100 and 1, but is it a math formula or something … | |
Hello, I have a problem with compiling my code... Platform: [b]Ubuntu Linux 10.04[/b] Compiler: [b]gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3[/b] IDE: [b]Netbeans 6.9.1[/b] My C program is required to exclusively deal with Unicode. I can use these functions just fine: [b][COLOR="Green"]wcscpy(), wcslen(), mbstowcs(), wcstombs(), snprintf()[/COLOR][/b] The problem seems to only be when … | |
I need to implement a function which ads elements to a single linked list: -if the head(first element) of the list doesn't exist(if head is NULL), then the added(inserted) element becomes the head(the the data entered is of string type) -if the head already exists, insert it after the last … | |
#include<stdio.h> #include<time.h> #include<stdlib.h> int paixu(int ,int);//洗牌声明 int main(){ int a[4][13],d,i,j,m,num=0,t=0,b[52]={0}; srand(time(NULL)); for(i=0;i<4;i++){ for(j=0;j<13;j++){ a[i][j]=j+1; } } for(;num<=52;){ d=rand()%52; for(m=0;m<num;m++){ if(d==b[m]){ break; } } if(m==num){ b[num]=d; switch(d/13){ case 0:printf("红桃");break; case 1:printf("方块");break; case 2:printf("草花");break; case 3:printf("黑桃");break; } num++; b[t++]=a[d/13][d%13]; printf("%2d%c",a[d/13][d%13],num%13==0 && num!=0?'\n':' '); } paixu(0,13);paixu(13,26);paixu(26,39);paixu(39,52); } }return 0; } int paixu(int m,int … | |
Hi! I have been learning c language on linux for two months.Today I have changed to Windows and don't know how to ,where to write programs and compile them and execution.Please exlain me. (Windows-7,acer) Thanx. | |
[code]Hi every one, i have to choose a project kindly give me idea what type of project i choose in c language i will rate my self 4/10 reply earlier because i don't have more time thanks[/code] | |
What are all the possible stamements that can be used in C, instead of printf and scanf statements? | |
Daily life magazine wants an analysis of the demographic characteristics its readers. The marketing department has collected reader survey records containing, the age, gender, maritial status, and annual income of the readers. Design an application that allows a user to enter reader data and, when data entry is complete produces … | |
//problem217C #include<stdio.h> int main(void) { int a=1,b=2,c=3,d=4; printf("\n1234"); printf("\n%d %o %x %c\n",a,b,c,d); printf("1"); printf("2"); printf("3"); printf("4"); } my output is: [Session started at 2010-09-14 17:57:05 -0700.] 1234 1 2 3 1234 The Debugger has exited with status 0. This is wrong, i dont know why? can some 1 help. | |
// I have no knowledge of using gcc compiler. Can some1 please help my creating my first program in c on mac book.... saving on desktop. //saving as testing.c on desktop .. // Creating C program #include<stdio.h> int main(void) { int x=2; printf("X=%d",x); return 0; } Building target “PracticeC” of … | |
HI I am currently in a college level programming class studying C, I've been enjoying coding and have seriously thought about it as a career... up until now. here is the link to the homework assignment if anyone is interested: [URL="http://www.engineering.uiowa.edu/~cie/Homework/hw02.htm"]http://www.engineering.uiowa.edu/~cie/Homework/hw02.htm[/URL] In short I have to create 2 matricies using … | |
Hello! I was making simple programm for word search, but found an error I can't explain. This code piece of code that causes it is: if (word==search){ printf("\n %i %s ", i, word); i++; } I can only suppose that the compiler(visual studio express) dosn't support such comparisions of sth … | |
how to print the below triangle without using arrays a a b a e i a b c d a e i o u | |
I am writing a program that duplicates the command: [CODE]grep -cr Thread nachos/ | sort -t : +1.0 -2.0 --numeric --reverse | head --lines=5 [/CODE] My code: [CODE] #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <sys/wait.h> #define R_FILE "/proc/meminfo" #define GREP_EXEC "/bin/grep" #define SORT_EXEC "/bin/sort" #define … |
The End.