15,550 Topics

Member Avatar for
Member Avatar for illuss

Hi guys, So i wrote a little code, not fancy, to convert a signed decimal to its binary representation using two complements. char immeStr[17]; int main(){ int neg = 0; int i = 0; int bit = 6; char binaryNum[bit+1]; int z1[bit+1]; int temp = -30; int k; int cout …

Member Avatar for deceptikon
0
164
Member Avatar for rithish

#include <stdio.h> int main(void) { int ten = 10; int two = 2; printf("Doing it right: "); printf("%d minus %d is %d\n", ten, 2, ten - two ); printf("Doing it wrong: "); printf("%d minus %d is %d\n", ten ); // forgot 2 arguments return 0; } hello actually i coulnt …

Member Avatar for Lucaci Andrew
0
134
Member Avatar for raj REDDY

suppose the input is 1,2,3,5-14,16-20,-25,31- :the program must print output: 1 2 3 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 0 1 2 3 ...........25 31 32 33..... til end of file I WAS REJECTED FROM MY LAST ROUND OF INTERVIEW BECAUSE …

Member Avatar for raj REDDY
0
199
Member Avatar for totalwar235

I am having problems with pointers and i am getting two errors saying "invalid argument type of 'unary *'" float getProfit(float* bushels, float price) { int i = 0; for(i = 0; i < 20; i++); { *bushels[i] = *(bushels[i]*price); } return 0; } any ideas on a solution? i …

Member Avatar for deceptikon
0
126
Member Avatar for shanki himanshu

i want to print a 'double' variable upto 8 decimal places without trailing zeroes. for eg: if a= **10.1234** then print **10.1234** if a= **10.00** then print **10** if a= **10.11111111111** then print **10.11111111** (max of 8 decimal places). how to do it? i searched for it and found this: …

Member Avatar for deceptikon
0
150
Member Avatar for anumash

I understood that when you pass the name of the array as an argument to a function we are actually passing the base address of the array, which inturn gets collected by a pointer variable and thus s[i]=*(s+i)=*(i+s)=i[s]. The problem begins when we turn to 2-D arrays. When we want …

Member Avatar for anumash
0
177
Member Avatar for JoeyJes

My questions are how to find the nth prime number? I have figured out how to find a list prime numbers. I'm just stuck as for being able to change my code to only print out the, say, 15th, or 500th prime not every previous prime as well. Any help/feed …

Member Avatar for VernonDozier
0
11K
Member Avatar for fyra

Hi. Nice to meet you. I'd like to know if I'm doing the allocation of memory from data to new_data correctly and why new_data only has one value since the memory of data was copied before to new_data. set size: 10 set[000] = 000 set[001] = 001 set[002] = 002 …

Member Avatar for fyra
0
280
Member Avatar for otengkwaku
Member Avatar for otengkwaku
1
397
Member Avatar for saintjey2000

**Write a C program for an automatic teller machine that dispenses money. The user should enter the amount desired (a multiple of 1000 naria) and the machine dispenses this amount using the least number of bills. The bills dispensed are 1000s, and 500s. Write a function that determines how many …

Member Avatar for totalwar235
0
165
Member Avatar for watery87

Hi guys. I would like to ask several questions about this. Im on my final phase of the proj, will appreciate some information. Qn 1: How do i make the user continually input till he types 'exit' to exit? Qn 2: If he types wrongly, or database couldnt find the …

Member Avatar for help738
0
195
Member Avatar for ashine80
Member Avatar for tofumaker

int x = 0; int i,j,p; int buf[4]; int *array[5] = {0}; for (j = 0; j < 3; j++){ for (i = 0; i <4; i++) { buf[i] = x++; } array[j] = buf; } int* temp; temp = array[1]; for (i = 0; i<4; i++) { printf("%d\n", *temp); …

Member Avatar for deceptikon
0
156
Member Avatar for raavn111

How to accept strings and print then them please explain me with example if possible Thanks in advance .............

Member Avatar for deceptikon
-1
137
Member Avatar for shukla ronak

hellow im am studen of the 4th sem information technology i wann a made a project in c turbo.how can i made

Member Avatar for Schol-R-LEA
-2
124
Member Avatar for necrovore

hello, I am working on a project that involves a bit of directory manipulation. Until now i only had to create create directories as per user input, so till now the commnad mkdir worked fine: mkdir("c:/test"); But now i have to do some manipulations on the string to get the …

Member Avatar for Moschops
0
195
Member Avatar for programmer007

Is it possible to convert a postfix expression to prefix expression using only recursion? If possible what's the algorithm?

Member Avatar for Taywin
0
117
Member Avatar for qqaa007

Hi, I have given a task to write a code about approximate of pi. this is what I wrote from the other example. the task is to : (pi^2)/16 = ((-1)^k)/k+1 (1+1/3+1/5+...+1/(2k+1)) Write a program which computes and prints an approximation of pi using a finite number of terms from …

Member Avatar for qqaa007
0
254
Member Avatar for mkbutan

i have put one FUNCTION (Display) in the code's but still not functional is there any way by which we can convert BCD to DEC code's and can be printed out as output I know its wrong please help me to make it right thanks [ the CODE's is for …

Member Avatar for ram619
0
139
Member Avatar for ram619

This code is crashing, please tell me for what all I need to assign memory. Thanks #include<stdio.h> #include<conio.h> #include<stdlib.h> struct s1 { char *p1; }; struct s2 { struct s1 *p2; }; struct s3 { struct s2 *p3; }*p4=NULL; int main() { char a='a'; p4=malloc(sizeof(struct s3)); p4->p3->p2->p1=&a; printf("%c",*(p4->p3->p2->p1)); return 0; …

Member Avatar for ram619
0
127
Member Avatar for ferdie.dumdumaya.33

Hi, can you help me please? how to make a program where you can enter the usrnme, then enter the paswrd, but the paswrd will be written in asterisk and only read afer pressing ENTER; if usrnme is correct and pass is correct, it will say "welcome" if usrnme is …

Member Avatar for deceptikon
0
85
Member Avatar for anumash

I want to write a program in C that will take a .wav file as an input and will output a C array i.e. raw PCM samples. I know the bitrate and have other information about the .wav file beforehand and I just want the PCM samples. The PCM samples …

Member Avatar for rubberman
0
2K
Member Avatar for Fredszky

Firstly, i'm really new to all this bash/unix/c stuff so i will probably get some words meanings wrong here, but anyway: Im trying to make a client pass simple shell commands to the server, which executes them. They communicate locally on the same machine through a socket. I can make …

Member Avatar for nmaillet
0
230
Member Avatar for dendenny01

**Algorithm** step1: display 3 choices step2: user inputs one choice step3: Choice is store in one variable step4: selected choice is transfered to switch function step5: choice is compare to cases step6: a text document is created stating you choice. **This is layout of the code:** #include<stdio.h> void main() { …

Member Avatar for dendenny01
0
456
Member Avatar for Stpdoug

Hey guys i have a small problem i would love some advice..this code outputs a hollowed box the problem is i cant get the right most column of the box in the right postion without tabbing it across..which will create problems if i want the user to determine how big …

Member Avatar for Stpdoug
0
106
Member Avatar for kyupa.suria

#include<conio.h> #include<stdio.h> #include<string.h> int mistakes_ctr=0; int x=52, y=22, i; void printM(){ gotoxy(20,20); cprintf("m"); } void printP(){ gotoxy(22,20); cprintf("p"); } void printL(){ gotoxy(24,20); cprintf("l"); gotoxy(34,20); cprintf("l"); } void printA(){ gotoxy(26,20); cprintf("a"); } void printN(){ gotoxy(28,20); cprintf("n"); } void printT(){ gotoxy(30,20); cprintf("t"); } void printO(){ gotoxy(32,20); cprintf("o"); gotoxy(36,20); cprintf("o"); } void printG(){ …

Member Avatar for kyupa.suria
0
207
Member Avatar for saurabh.mehta.33234

Is the sizeof operator in c a compile time or run time operator..Because the following code works fine with a gcc compiler int a; scanf("%d",&a); printf("%d",sizeof(a)); But I found in one of the tutorials thatsizeof is compile time??Can someone please clear the confusion?

Member Avatar for deceptikon
0
392
Member Avatar for Gado

I have this file 3 10 10 10 0 0 0 0 0 1 1 0 0 1 1 1 1 0 0 0 1 1 and I want to read the first line as intger in X the 2nd line in camp1 the 3rd line in camp2 line 4 …

Member Avatar for Gado
0
188
Member Avatar for mayankjain05_1

this is the question. www.codechef.com/problems/CTEAMS i wrote this code http://ideone.com/h5Gimy it gives success but when i pass an input it gives sigsev error.please someone help!!

Member Avatar for mayankjain05_1
0
195
Member Avatar for enkitosh

Hey everoyne. I'm wondering If it's possible to construct a switch statement which takes in a character and determines weither that character is a number or not, or an alphabetical number. switch(i) /*character*/ { case '0': /*ok it's a number, doesn't have to be zero, any number from 0-9*/ case …

Member Avatar for enkitosh
0
312

The End.