15,555 Topics
![]() | |
Hi, i understand the ieee 754 representation. but can some one explain why we need to add specifically 127 to the power of 2. for ex: 5.75 ; 101.110 can be written as 1.01110 * 2 ^ 2 127 +2 = 129 . i.e 10000001 now IEEE 754 of 5.75 … | |
below is one simplest code to illustare the pyramid of number. [CODE] void piramid(int const c) { int r, x; for (r = c; r > 0; r--) { for (x = 1; x < = (2 * c - r); x++) { if (x < r) printf(" "); else … | |
Hello, I have a query on dynamic allocation of memory in C. I am storing 4 seconds of audio data in a buffer allocated with sufficient memory using malloc function. If I wanted to record another 4 seconds of audio in the same buffer, I would have to increase the … | |
HI I want to write a class that it gets two decimal numbers and add them without using decimal expression like double and float . for example 12/05 + 1/98 =14.3 How can I do so ? thanks | |
Question 1: [CODE]main() {int i=-3,j=2,k=0,m; m=++i||++j&&++k; printf("\n%d%d%d%d",i,j,k,m); } [/CODE] ans is -2201 how? Question 2: [CODE]main() { int a,b; a=sumdig(123); b=sumdig(123); printf("\n%d%d",a,b); } sumdig(int s) { static int s=0; int d; if (n!=0) { d=n%10; n=(n-d)/10; s=s+d; sumdig(n); } else return(s); } [/CODE] please explain the ans | |
Can someone please explain the meaning of these return 1 vs return 0 vs break. I know 1 generally means true and 0 generally means false but how would they effect a return statement? Also when would you wanna use a return statement instead of a break statement and vice … | |
Hello all, When I try to compile a small program I am getting an error that I do not quite understand. I get this error: media_tracker1.c: In function 'add': media_tracker1.c:152: error: expected expression before ';' token when I try to compile this code: [CODE= "c"] #include <stdio.h> #include <stdlib.h> #define … | |
hi, I have a problem with BST. For example after the insertions of below numbers, 23 1 45 2 3 5 52 234 31 The output should be like this way: [B]23[/B] [B][/B][B]1,45[/B] [B][/B][B]-,2 | 31,52[/B] [B][/B][B]-,- | -,3 | -,- | -,234[/B] [B][/B][B]-,- | -,- | -,- | -,5 … | |
Hello guys. I am working on the code below. I am trying to create my own shell. The code compiles without errors, but when I execute it though it doesn't output anything. I have tried it with /bin/ls as input and it doesn't work. Any suggestions? [code=c]#include <stdio.h> #include <stdlib.h> … | |
Hi frenz, the above code runs perfect. But while printing the arrays x y z the value of y[0]changes...could u plz help me in sorting this problem.. thank u.. this is the output.. [B]x y z[/B] 1 -1 0 2 4 -2 3 3 0 4 2 2 5 1 … | |
![]() | Hi guys, I have a txt file in which each line contains information in following format: VELOCITY<100.0> LAT_1<N 00 00.0000> LON_1<E 000 00.0000> SIMULATE<false> I would like to write a C or C++ programm to select only the values of the words I need. I need those values to do … |
I have been trying to check Internet connection but all ways I have tried have failed. Some example code would be great, or the package to use. Thanks very much. | |
Please, I have tried everything that I can learn from a book...any help with this problem is greatly appreciated. I've spent days writing and modifying and I am just lost now. Is there anybody that can help me solve this question using C language? You are developing a database of … | |
Hi, I am required to first read a number, n and then n lines of string. The strings can contain leading spaces which has to be preserved: 2 " hello world" ... using [CODE]scanf("%d", &n); for (int i = 0;i < n;i++) { scanf(" [^\n]", message); .... printf("Case #%d: %d\n",case_count, … | |
i need a c programme that reads a txt that you chosse then count the number of each word in the programme i have e.g. "hello this word is very funny this is not" hello 1 this 2 word 1 is 2 very 1 funny 1 not 1 i would … | |
Why the output is 100? [CODE]#define f(g,g2) g##g2 int main() { int var12=100; printf("%d",f(var,12)); return(0); }[/CODE] | |
I'm curious why all the events code and autogenerated code when controls are added to the form are written to the form1.h instead of the form1.cpp. Is this a configuration item? This defeats the purpose of information hiding by separating the declaration from the implementation. | |
hello . I have a problem. I have a variable DWORD num= 0x1234ABCD i want to convert it to char * for example- char * result[0]= '[the ASCII of 0x1]' result[1]= '[the ASCII of 0x2] result[2]='[the ASCII of 0x3] ... How can i do this?? thank you very much! | |
I am almost completely brand new to programming (been in my first programming class for about a month), and I am trying to learn stuff that my professor isn't teaching yet so that I don't get behind later, and I am doing this by writing simply programs and learning all … | |
Can some one please help me in writing a program for the INSERT AND DELETE operation on a BST, the operation functions must be NON-RECURSIVE ?? | |
Hi, I am trying to understand the Standard C function "getchar()". I am using CodeBlocks 8.02 in Windows XP. Please compile this code in your compiler and note how it behaves: [CODE]#include<stdio.h> int main() { int i=getchar(); while(i!=9) { printf("%d",i); i=getchar(); } printf("%d",i); return 0; }[/CODE] When I insert Tab, … | |
ok I'm taking a text file.. 16 lines.. 6 character values per line and trying to randomly get one character per each line.. and place them into a 2d array (4x4). The values i'm getting aren't correct for some reason.. anyone have any helpful tips? [CODE] int main() { srand … | |
Hi All, Today I came across a peculiar piece of code. [code] int main(int argc, char* argv[]) { printf("%lf\n",(0.99-0.90-0.09)); } [/code] According to me the output for this code should be 0, but to my surprise when I ran this code the answer that I got was -0.000. I cannot … | |
hello, Here's a simple question I want to clear up. We all know that we can use the name of an array as the pointer to that array, and that a pointer holds the address to the variable named. What I'm doing is this [CODE] //somwhere in the code uint8_t … | |
Hi to everyone here! I'm a newbie! I just wanna ask help from you especially from the administrator regarding my machine problem..... I am asked by my proffesor to create a slot machine program. This is how it goes... The simulation starts by presenting the player with a menu of … | |
Can you please give me a list of all of the % letters that go with int, floats, and doubles in printf and scanf. | |
i need help about the String codes.... its about how to delete a string.. like for example it displays like "The Dogs and Cats" the program wants the user to choose what to delete like i want to delete the Dogs.... and the result is now "The and Cats" cause … | |
i am getting linking errors while i try to program graphics in turbo c "unable to open file tcclass.lib"please help | |
Im trying to make a program that will sort the the list according to its cost...from least to expensive... here's my code: [CODE]#include <stdio.h> #include <string.h> typedef struct resto RESTO; struct resto{ char *name; char *address; float cost; char *food; }; void output(RESTO r1); int main() { RESTO r1= {"Coras","Agora",60,"BBQ"}; … | |
I'm trying to convert a double w/ a string of characters w/o using sprintf and padding w/ 0's.. omg... driving me nutz.. what I have thus far.. [CODE]#include <iostream> #include <cstdlib> #include <cmath> #include <deque> using namespace std; void d2s(double,char[], unsigned int); int main() { while (true) { double num; … |
The End.