19,876 Topics

Member Avatar for
Member Avatar for cutedipti

Hi I need one example on regression. Also tell between recursion and regression which one is faster?

Member Avatar for Narue
0
98
Member Avatar for Aus89

I have the following code, the arrays are global variables. [CODE] #define MEMORY 64000; #define NUMFRAMES 6400; int mem[MEMORY]; int frames[NUMFRAMES]; [/CODE] I was pretty sure this should work as I don't see why it shouldn't but I am getting "parse error before ';' token" for both array declarations. Although …

Member Avatar for Narue
0
121
Member Avatar for sanushks

I'm a C novice, require help on parsing text files and storing in an array or another text file: Below is the data which are partly pipe delimited values and part of it are name-value pairs, for instance the "cma{PL}Ind{1}man{6}gal{0}cif{}" mentioned below cma is the field name and PL is …

Member Avatar for sanushks
0
130
Member Avatar for Kerry

[COLOR=Blue][SIZE=2][FONT=Times New Roman]Hello, my name is kerry and i just sign up .Well, my question is how do reverse a number input by user using recersive function.Thanks for the help. [/FONT] [/SIZE] [/COLOR]

Member Avatar for c0ld sn1ff3r
0
509
Member Avatar for srivtsan

Can someone tell me how the series is to be implemented in c 1,1,1 2,1 2 3,1 2 3 4 5, 1 2 3 4 5 6 7 8 here is my code but i am not able to get the answer [code] #include<stdio.h> int i,n1=0,n2=1,n3,n; void main() { printf("\n …

Member Avatar for Aia
0
97
Member Avatar for serkan sendur

i am pretty new to assembly language and i wonder what is difference between the final binary output of the same program written in c and written in an assembly if they do exactly the same thing. if the binary output is the same then why use assembly language? if …

Member Avatar for Ancient Dragon
0
333
Member Avatar for rysin

Ive began a book to learn c++ and in the first chapter I ran across my first question(thats never good...). In the book it says I should use this same template in every single c++ program I EVER make. The template is [CODE] #include <cstdio> #include <cstdlib> #include <iostream> using …

Member Avatar for rysin
0
104
Member Avatar for anny**

see buddies i make a program in c but it take enter 1st number then ask for opearator and then directly tell that wrong opearator iam tired but i cant find where is problem here it is ::::: [ICODE] #include <conio.h> #include <math.h> #include <stdio.h> #define PI 3.14159265 int main() …

Member Avatar for Narue
0
153
Member Avatar for Benbon86

Hey guys, I'm new to C++ and in desperate need of help. I'm trying to write a program that is like powerball. I need to generate six random numbers. The first five numbers need to be in the range of 1-55 while the sixth number is in the range of …

Member Avatar for Benbon86
0
688
Member Avatar for maker10

Hi All, I'm trying to figure out how I canFirst, enter the number of salaries to process: 4 Now enter the 4 salaries to be averaged. Enter salary #1: 10000 Enter salary #2: 8000 Enter salary #3: -20000 *** Invalid entry. Salary must be positive. *** Enter salary #3: 25000 …

Member Avatar for Sci@phy
0
76
Member Avatar for TheBeast32

Hi, I keep getting an undefined identifier error when I try to do this: [Code=C] typedef char bool; // Make a bool type char false = 0, true = 1; // Make true and false void foo() { switch (something) { case 1: bool aaaaa; break; } } [/Code] It …

Member Avatar for Sci@phy
0
69
Member Avatar for PhoenixInsilico

The following program should take 4 numbers but it takes 5 numbers and prints first 4 number entered. How to correct the problem??? [ICODE]#include<stdio.h> #include<conio.h> void main() { int a1,a2,a3,a4; printf("Enter 4 numbers \n"); scanf_s("%d %d %d %d ", &a1,&a2, &a3, &a4); printf("The 4 numbers entered are %d %d %d …

Member Avatar for PhoenixInsilico
0
80
Member Avatar for rrreeefff

#include "stdafx.h" #include "stdio.h" [code=cplus] void swap (int a, int b); int main (void) { int a,b; printf("enter 2 positive integers"); scanf("%d",&a,&b); swap (a,b); printf("d%d,a,b\n"); } void swap (int a, int b) { int swap (a,b); } [/code] I have one error (20) : error C2078: too many initializers

Member Avatar for Denniz
0
85
Member Avatar for rugs267

I'm very very new to C so I'm having some trouble with this (and pointers): I'm trying to pass four parameters into a function: birthdayFunction(char birthday, int month, int day, int year); The birthday is the string input from the user (with "/" separating each field, ex. 7/23/76) and I …

Member Avatar for rugs267
0
110
Member Avatar for anny**

hi to everyone !!! anny here ,. i want to make a program using c which can calculate following functions :: [COLOR="red"][B][I]sin,cos,tan,+,-,*,/,iverse,log,ln,exp,sqrt,raise to power 100,10,2[/I][/B][/COLOR] plz plz if anyone can help me by giving me some idea about it and which is somthing of beginners level !! thanxx alot !

Member Avatar for ahamed101
0
178
Member Avatar for slow14

I'm trying to add a username, password, firstname and lastname on a text file. Everytime I run the program, it only accepts one username, password, etc. Can anyone please help? here's my code. [code=csharp] #include <stdio.h> #include <string.h> #include <stdlib.h> typedef struct { char UName[50]; char PWord[50]; char FName[50]; char …

Member Avatar for ahamed101
0
157
Member Avatar for dhingra

[code=c] void main() { int i,j; /*input values of i and j*/ while(i*j<0&&++i!=7&&j++!=9) { do something; } [/code]

Member Avatar for ahamed101
0
111
Member Avatar for seogoat

I want to learn how to use stack and ques in c++, but I don't know how to start. Where should I look on the internet? Or does anyone have any ideas?

Member Avatar for dmanw100
0
105
Member Avatar for leouel

does anybody know how to create a program with vertical chart using graphics.h pls help.. <snipped email>

0
51
Member Avatar for Demonisya

Hello....everyone I want to ask you for your advice on what problem I'm gonna do.... So my teacher grouped us and make a program that we ourselves would make.... we can do that but what kind of program do we have to make, any suggestions???? My teacher said that the …

Member Avatar for Demonisya
0
103
Member Avatar for mgirl

:) Hi, Ive written a program that is supposed to count the number of people of different ages and calculate the average of valid ages. We exclude ages entered as 0, over 130 or negative. The program does run but I sometimes don't have the right number in the different …

Member Avatar for Ancient Dragon
1
91
Member Avatar for jared_masc

Iam meant to implement 3 methods that do the same thing differently to read in a string and the string that is read from the keyboard must be terminated with an end-of-string character. Also, it should not contain any new line character. iam supposed to use fgets(), getchar() and scanf(); …

Member Avatar for stilllearning
0
122
Member Avatar for shrikara

this is my code I am using in Unix machine, using cc compiler: [code=c] #include<stdlib.h> main() { int nr=0,nc=0; printf("Enter number of coulmns:"); scanf("%d",&nc); printf("Enter number of rows:"); scanf("%d",&nr); int *x,temp; printf("Enter the matrix:\n"); for(int i=0;i<nr;i++) { for(int j=0;j<nc;j++) { scanf("%d",&temp); *(x+i*nc+j)=temp; } } for(int i=0;i<nr;i++) { for(int j=0;j<nc;j++) { …

Member Avatar for kenji
0
134
Member Avatar for Melab

I'm looking for a very easy to use compiler that I don't have compile or download any other stuff for and on that is a GUI app.

Member Avatar for Narue
0
83
Member Avatar for danibootstrap

Hi, I want to write a simple code to change the mouse pointer position.Like I enter the value of X and Y and the mouse pointer should get positioned to that co-ordinates.What are the specific functions that I need to use to set mouse position and get mouse position?I searched …

Member Avatar for danibootstrap
0
121
Member Avatar for it2051229

I'm looking for the header file of shm.h , although i've seen some on the web but when i use it the prototype methods are not implemented.... where can i download the full shm.h?

Member Avatar for Salem
0
118
Member Avatar for Stella01

why we use different libararies in C can some one PM me all Libararies ?

Member Avatar for Dave Sinkula
0
100
Member Avatar for jared_masc

Hi, iam writing a pig latin program with 3 different methods i dont knw understand the error that iam gettin in the code here's the code: [code=c] #include <stdio.h> /*Include the standard I/0 header file */ #include <string.h> /*Include the standard I/0 header file string library */ //The functions that …

Member Avatar for stilllearning
0
248
Member Avatar for En-Motion

i need to get a printout of a c program running using dos-redirection. Does anyone know how i can redirect the output to a texfile so i can print it?

Member Avatar for ahamed101
0
298
Member Avatar for tondet2

attempt to display an electricity bill that looks, for example, like this: ********************************* Present meter reading 6015 previous meter reading 5899 Units used 116 Rate per unit 6.73 pence Standing charge £7.78 The sum due is £15.59 ********************************* This program displays an electricity bill, given a present meter reading and …

Member Avatar for ahamed101
0
90
Member Avatar for ahamed101

Hi Everyone, I know conio.h is not available in Unix. I want to use getch(). Using curses.h needs causes the screen to clear which I don't want. I found a code snippet (source : internet) using termios, it works, the thing is I need to press enter/or any other key …

Member Avatar for ahamed101
0
1K
Member Avatar for jared_masc

Hi, i'm really new to programming in C, and iam kind of stuck on this problem, the question is [B] Write a C function to print out an integer value in base 4 (using only the digits 0, 1, 2, 3). Use this function to write a program that reads …

Member Avatar for ArkM
0
114
Member Avatar for rrreeefff

Hello, I am working on a non-recursive function that computes a to the power n. I have one error which is cpp(23) : error C3861: 'mypower': identifier not found [code=cplusplus] #include "stdafx.h" #include "stdio.h" double power(float a, int n); // function prototype// int main (void) { float a; int n; …

Member Avatar for devnar
0
498
Member Avatar for RouseA

I am trying to define peripheral ports in an embedded application as variables at fixed addresses (e.g. PortA is at address 0x10010). I could do this using #define: #define PortA *(u32*)0x10010 However, this wouldn't allow me to view the value of PortA in a watch window when debugging, since there …

Member Avatar for Salem
0
155
Member Avatar for totalnoob

Hi! As you can see by my name I'm new to programming. I have a program that only works partially. It consists of two functions. One function creates a text file and reads it and the other one creates a binary file and reads it. The text file part works …

Member Avatar for totalnoob
0
80
Member Avatar for En-Motion

I have to write a program where a user trys to pick a number. The code i've written below always exits after 2 guesses abd says the guess was correct even if it's wrong. Can anyone see what i'm doing wrong? Thanks [code]# include <stdio.h> # define NUMBER 50 int …

Member Avatar for En-Motion
0
104
Member Avatar for mikeregas

I need this to been done recursively, it works but I was told that it is not recursive does anyone have any ideas or suggestions [code=language]#include <stdio.h> #include <string.h> #define TRUE 1 #define FALSE 0 main () { char decision; char str[30]; int isPalindrome = TRUE; int choice = TRUE; …

Member Avatar for ArkM
0
143
Member Avatar for mikeregas

my question here is two fold I am new to recursion and I am not going to lie. I dont get it at all, well at least the code part. is this considered recursive? and the second question is how do I make a loop that would let the user …

Member Avatar for stilllearning
0
74
Member Avatar for justinlake888

I am working on a code and I want it to ask if I want it to enter another number... when I hit "y OR Y" it repeats but the code. I don't know how to make it output "bye" when I type "N or n". Can someone please help …

Member Avatar for stilllearning
0
114
Member Avatar for StainlessSteelR

I am having a hard time with my homework and I was wondering if someone could help. I have to create a program that uses a while loop to ask questions about a hotel. It first ask the number of the top floor then asks How many rooms are on …

Member Avatar for VernonDozier
0
191
Member Avatar for patricksquare

[code=c] x=0; t=0; int t2=0,t3; while(t<=ref) {t3=t2; for(x=0;x<jbn;x++) { if(t==cpy2[x].at) { if(q>=cpy2[x].bt) { t2+=cpy2[x].bt; tt[x++]=t2; cpy2[x].bt=0; qq++; } else if(q<cpy2[x].bt) { t2+=q; cpy2[x].bt-=q; cpy2[x].at=t2; qq++; } } else break; } t++; if(t3==t2) {t2++;} }; [/code] assuming the values are cpy2[0].at==1 cpy2[0].bt==2 cpy2[1].at==2 cpy2[1].bt==3 cpy2[2].at==4 cpy2[2].bt==4 q==2 qq is just an …

Member Avatar for WaltP
0
112
Member Avatar for mikeregas

here is the code that I have so far and I can not seem to get it to work properly it is return 1 for any number that is entered. Any help that you can give me would be greatly appreciated. Thanks [code=language]#include <stdio.h> double square_root(double low, double high); int …

Member Avatar for chrissygirl
1
2K
Member Avatar for chrissygirl

hey guys, im trying to write a program recursively that takes in how many times the user wants to flip a coin, and prints out all the possibilities. i am having a hard time figuring it out. id apreciate some input. here is the code i have so far... [code] …

Member Avatar for tessen
0
254
Member Avatar for adityasaten

hi friends, First I want to introduce myselt, I am Aditya and have little knowledge of programming because I have enter in this field just os i face problem with c and need your kind solution, your reply would much valueabel for my bright future... I have a problem in …

Member Avatar for abhijeetcn
0
119
Member Avatar for J-son

Hi there ... I need help with the following program.It is giving me error. Thanks very much. [CODE=c] /*Write a structure function to enter Roll number, Name, Department, Course, Year of joining and print them out */ #include <stdio.h> struct student { char name; char dep; char course; int roll; …

Member Avatar for abhijeetcn
0
148
Member Avatar for eddyhutchins

Hi there, I just saw the thread about helping with assignments but I'm hoping you will be able to share your knowledge with me on this. We have had one week to complete this assignment and I'm beginning to worry I won't be able to finish it, I've tried to …

Member Avatar for LizR
0
161
Member Avatar for Talli

can someone make a simple program that prints numbers in series depending on the persons input .. for eg :- if input is 5 then output should be : 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 ....please help asap .. thank you …

Member Avatar for Talli
0
133
Member Avatar for rrreeefff

Hello, I need to modify the following function to compare with the library power using power (double, double) [code=c] #include "stdafx.h" #include "stdio.h" double mypower(float a, int n); // function prototype// int main (void) { float a; int n; int power; printf("\n enter a value of a\n"); scanf ("%d", &a); …

Member Avatar for Aia
0
77
Member Avatar for tatainti55

Why do i get this error every time i try to compile an SDL source code? D:\gcc installation problem, cannot exec `cc1': No such file or directory. That's the ONLY error i get.

Member Avatar for tatainti55
0
117
Member Avatar for rob_xx17

hello, I'm trying to write a simple program that proves mathematical theorems (predicate calculus). What I need to do is to have a small database that holds all of the propositions ('abc'; 'b'; 'cde'; etc.). What I'm having a problem with is creating a function that would act as a …

Member Avatar for Salem
0
105

The End.