18,490 Topics

Member Avatar for
Member Avatar for darkeinjel04

Here's my Prog...i dunno how 2 convert it...pls check.. its a pyramid... #[code] #include<stdio.h> main() { int a, b, c, d=0; clrscr(); printf("Enter a No:"); scanf("%d",&c); for(a=1;a<=c;a++) { for(b=1;b<=c*2-1;b++) if (b<=c+d&&b>=c-d) printf("*"); else printf(" "); printf("\n"); d++; } getch(); } [/code] is my program correct? the output must be..a pyramid

Member Avatar for darkeinjel04
0
431
Member Avatar for Ahmed Waheed

[COLOR=Black]:) please,want help: how can i read line "Message ended with <CR><LF> " from serial port buffer using ReadFile() API function . I was do that and worked good ,but when enter into large for loop it returned NULLs. so i want to know where is the problem?!! :rolleyes: thanks …

Member Avatar for Nick Evan
0
104
Member Avatar for redstar

Hi i have this program and have a problem it is a basic program for exponents and now i need to add a while loop so that if the user enters a number greater that 10 it asks them to input a number lower or equal to 10, here is …

Member Avatar for Nick Evan
0
307
Member Avatar for sciconf

How to extract the opcode and the data form the instruction? "instruction" is inst below in decimal. For some values of "??", I should be able to extract the opCode and data??? opCode = inst >>??; data = inst & ??; It is done on a x86 processor using C. …

Member Avatar for Salem
0
135
Member Avatar for friendz_
Member Avatar for Ancient Dragon
0
70
Member Avatar for hariza

Hi Guys, I'm trying to remove all the special characters within a file using the code below but I need to remove also the doble quotes " but what should I use to enclose the characters. I've been looking but can't find. Thanks. while (sep != 0) { sep = …

Member Avatar for hariza
0
603
Member Avatar for lalalu

im trying to create a structure that contains an array of structures but i keep getting error when compiling the code (corrupt stack). just to make sure, is my struct code correct? [code] typedef struct status *StatusPointer; struct status { int item; }array[MAX_NUM]; typedef struct allStatus *AllStatusPointer; struct allStatus { …

Member Avatar for lalalu
0
1K
Member Avatar for jeffssmith

I'm taking CSCI 230 and was able to get a triangle to print with the following code. I can't get anything to work for a circle or rectangle (similar in size). Can anyone help? Thanks. #include <stdio.h> int main() { int t; int x = 0; int y; t = …

Member Avatar for andor
0
93
Member Avatar for highlanda

Main problem i am having is that with the program it can have a 2 string equation - eg 25 R or 25 S (Reciprocal and Squareroot) or a 3 string equation where the second string will be a number and the third string will be the operator. eg 10 …

Member Avatar for andor
0
131
Member Avatar for amishosh

Hi! I've tried to split it up a program I made for school into 3: header.h: has the functions declarations. func.c: contains the fundctions body. body.c: uses the functoins. Here's my code: [code] /* header.h */ void kelet(char *p); void copy(char *p1,char *p2); void insert(char *p1,char *p2); void reverse(char *p1); …

Member Avatar for Anonymusius
0
160
Member Avatar for boujibabe

this code to convert pounds to barbados dollars given a constant rate the price cannot go over $100 when i first run it and input a number under 100 it tells me that it is invalid and sometimes i get nothing at all. Can neone tell me why? [code]/* This …

Member Avatar for ~s.o.s~
0
103
Member Avatar for SammyHasibi

[code] { FILE *scorefile; int score; int temp; scorefile = fopen("scores.txt","r"); if (scorefile == NULL) printf("Error opening input file\n"); else { temp = 0; while (feof(scorefile) <= 0) { fscanf(scorefile,"%d",&score); temp = temp +1; } } fclose(scorefile); printf("Temp = %d\n",temp); system("pause"); return(0); } [/code] The program counts the number of …

Member Avatar for andor
0
257
Member Avatar for zac_haryy

Well I have started writing a code to create this program that i have to have done by tommorow but i am stuck at the moment. Anybody please help!! Here is the problem: Write a prgram that converts numbers to words. For examlpe, 834 should result in "eight three four." …

Member Avatar for ~s.o.s~
0
118
Member Avatar for amishosh

Hi! I have functions defined in ami.c and want to call them from friedman.c how do I link the 2? Thanks Ami

Member Avatar for ~s.o.s~
0
274
Member Avatar for Sivakumar_K

[B][COLOR=darkorange]My resource.h file:[/COLOR][/B] [code] #define IDR_MYMENU 101 #define IDI_MYICON 201 #define ID_FILE_EXIT 9001 #define ID_STUFF_GO 9002 #define ID_STUFF_ABOUT 9003 #define IDD_TOOLBAR 9004 #define IDC_PRESS 9005 #define IDC_OTHER 9006 #define ID_DIALOG_SHOW 9007 #define ID_DIALOG_HIDE 9008 #define ID_HELP_ABOUT 9009 #define IDD_ABOUT 9010 [/code] -------------------------------------------------------------------------------------- [B][COLOR=darkorange]My resource.rc file:[/COLOR][/B] [code] #include "windows.h" #include "resource.h" …

Member Avatar for Ancient Dragon
0
85
Member Avatar for hariza

Hi Guys , If I have a file compouse by words one per line how can I get all the words to put them together and have them separated only by one space. Also how can I make sure I'm extracting only words and not numbers or special character. I …

Member Avatar for Ancient Dragon
0
105
Member Avatar for jan1024188

sory im complete newbie i have [code]include <stdio.h> int main() { int x; for(x=1; x < 10; x++) { printf("%d\n second ", a); } return 0; }[/code] [code]for.c:1: error: syntax error before ‘<’ token [/code]

Member Avatar for jan1024188
0
104
Member Avatar for jan1024188

ive got this [CODE]#include <stdio.h> #include <unistd.h> int main() { int a; int b; a = 3; b = 30; until (a == b) printf("%d\n second ", a); a++; usleep ( 990000 ); printf("\n\n hvala ker usate ta pgr \n\n"); return 0; } [/CODE] but i got this error when …

Member Avatar for jan1024188
0
95
Member Avatar for jan1024188

i have [CODE]#include <stdio.h> int main() { int a; int b; a = 3; b = 30; while (a < b) { printf("%d\n crap .....", a); a = a + 1; } return 0; } [/CODE] i got output [QUOTE]crap .....4 crap .....5 crap .....6 crap .....7 crap .....8 crap …

Member Avatar for ~s.o.s~
0
142
Member Avatar for suhasrao

[B]Hello everyone.....[/B] [B]I wanted to know how can we send and receive data from usb port[/B] [B]using c programming[/B]......

Member Avatar for Salem
0
42
Member Avatar for rowly

Hi, can any one tell me what size_t_count does, i couldnt get it . thanks guyz ! [code] fwrite([COLOR=#0000ff]const[/COLOR] [COLOR=#0000ff]void[/COLOR]*_str,size_t_Size,size_t_count,file *_File); [/code]

Member Avatar for rowly
0
391
Member Avatar for jan1024188

please help me [url]http://www.linuxforums.org/forum/linux-applications/72657-qt3-designer.html[/url]

Member Avatar for jan1024188
0
111
Member Avatar for jan1024188

ok im newbie... i have a question if i have [code] #include <stdio.h> int main() { printf("type something:"); char a; scanf("%c", &a); printf("%c\n" ,a ); return 0; }[/code] i will aways get one character in output.My question is: -how to get world "hello" as standart output from variable using printf?

Member Avatar for jan1024188
0
149
Member Avatar for Laiq Ahmed

i want to calculate the complexity of the following code snippet [code] for(int k=0;k<n; ++k) for(int j=0; j<k; ++j) for(int i=0; i<j; ++i) cout<< "Hello World" <<endl; [/code] here! i got the hint! that summation of natural numbers series would be used if its correct why ? bit confused:sad:

Member Avatar for Infarction
0
114
Member Avatar for sugantha

I am doing a lexical analysis program and this is a part of the code that counts number of keywords [code] int keyword=0; char str[]="int float + - 78"; char* ptr; ptr=strtok(str," "); while(ptr!=NULL) { if(((strcmp(ptr,"int"))||(strcmp(ptr,"float")))==0) keyword++; ptr=strtok(NULL," "); } cout<<keyword; [/code] to my knowledge there is no imbalance of …

Member Avatar for Member #46692
0
121
Member Avatar for hano

hi iface aproblem in c program i want to write aprogram to read R={(1,2),(2,1),(3,3),......} then covert it to matrix0/1 please help me quickly

Member Avatar for Member #46692
0
101
Member Avatar for usr1971ca

There is an algorithm in the software program that other team handed to me on linux. Given a set of requirements, our task is to create a test script/driver to verify that algorithm using a separate data file and spit out the result on the output file. The concept is …

Member Avatar for WaltP
0
149
Member Avatar for Jean5

Hi all I'm looking forward to purchase ExeCryptor ([url]www.strongbit.com[/url]) to protect my shareware. But before I'd like to know independent opinions/experience if any. My question is: Anybody uses execryptor? Can you tell me smth about? Are there some problems? Is it cost-effective? Thank you in advance for any reply Jean

Member Avatar for DMR
-1
197
Member Avatar for Seadragon

I am new at this but I think I may have it. This is the assignment: The program should ask for the Customers First Name and Last Name (Use Initials only for now) -Use 2 different variables, one for the first name and one for the last The program should …

Member Avatar for secretunfold
0
103
Member Avatar for shermaine

Hi, I got some doubts...may i know what is mean by x&01? and b++?

Member Avatar for Grunt
0
94
Member Avatar for zac_haryy

I keep on getting the erro "error C2064: term does not evaluate to a function taking 1 arguments" I have three of these errors and they are all on the first line after the if statements. I really dont know what is going wrong. Been working on this error for …

Member Avatar for zac_haryy
0
119
Member Avatar for tlly

Hello...I need to write a program where i need to copy each word of a string into an array... Eg(string s="hello how are you" arr[0]=hello,arr[1]=how....). any help:?: ??

Member Avatar for WaltP
0
119
Member Avatar for shermaine

Hi, Anyone here can advise me correction of my c programming? It doesn't seem to be working. #include<stdio.h> float x[4] = {1.2,2.4,3.6,4.8}; float f[4] = {0.1,0.2,0.3,0.4}; float xave = 0.0; float ftotal = 0.0; main() { int i; for (i=0; 1<4;i++) ftotal + = f[i]; if(ftotal!=1.0) { printf("error\n"); exit(); } …

Member Avatar for vegaseat
0
198
Member Avatar for clb2196

Hey guys, I'm new to C- I do Java- and for our OS class we're doing some basic code examples in C, on Linux. (Fedora core, if it matters). We're supposed to write a test program that shows the difference between how threads are run with round robin and fifo …

Member Avatar for Salem
0
257
Member Avatar for shermaine

The question is :Write a function bigger() that returns bigger vaule in a signed integer array. Array and size are passed as arugements. Write a main program that inputs Max values from the keyboard into siged integer array,array and prints using biggest(), the biggest vaule to the screen What should …

Member Avatar for WaltP
0
151
Member Avatar for pallavi jadhav

How to connect postgres through c language please send me connection establishing statements and theoriical notes.I am into development of querry optimiser in that i have to calculate the cost of the query with respect to space search strategy.please tell me about this also

0
101
Member Avatar for rowly

[COLOR=seagreen]hi, i didn't get any reply probably coz ya didn't understand what i mean ![/COLOR] [COLOR=seagreen]alright i'll make it simple.[/COLOR] [COLOR=seagreen]i have a file in excel and i have to read from this file [/COLOR] [COLOR=seagreen]here is the contents of this file[/COLOR] [TEX] [COLOR=seagreen]2,joined,2929828,429.6,2[/COLOR] [COLOR=seagreen]4,toytoy,2929299,122.8,19[/COLOR] [COLOR=seagreen]3,front shift,2299229,205,22[/COLOR] [COLOR=seagreen]3,shift,1111111,222,20[/COLOR] [COLOR=seagreen]...[/COLOR] [COLOR=seagreen]...[/COLOR] …

Member Avatar for rowly
0
116
Member Avatar for vbcielle

i want to add all the inserted linked list by using this code but what happens here if i input 15 then 35 =50 but when i input again 30 the sum is 50whats wrong with my code? [CODE] int sum(nd **head){ nd *p,*sum1; p=*head; sum1=0; while(p!=NULL) { sum1->x=p->x; p=p->next; …

Member Avatar for vbcielle
0
181
Member Avatar for whitemoss

Hi all, I'd posted this problem previously but in the wrong place..:)..Hopefully, I can get the answer from this thread. I'm a newbie in C..Right now, I have to write a code to read a text file and then insert all the info inside that text file into database. Should …

Member Avatar for whitemoss
0
576
Member Avatar for rowly

Hello, can you guyz help write a while loop to read this line, for example 2,Joind,2082421,235.6,8 2= number Joind = item 2082421 = item number 235.6 = item price 8 = day all what i'm tryin to do is while reading each line if we encounter a ',' store all …

0
84
Member Avatar for yenh

Hi everybody, I need some helpings to calculate time complexity(worst case, best case and average) for following code : int m = A[0]; for (int i=1;i<n;i++) {if (A[i]>m) m = A[i];} int k = 0; for(int i = 0; i<n;i++) {if(A[i] == m) k++;} Thank you ........................

Member Avatar for Ancient Dragon
0
104
Member Avatar for shermaine

I have got this question: Write function of f(x) that return the number of bits set to 1 in an unsigned integer. So the outcome of the result will be sometime like f(5) = 2 cos [5 in binary is 101 and it got 2 '1s') Here's my program: #include …

Member Avatar for Ancient Dragon
0
357
Member Avatar for vijaiendran

how to pass a string as an argument to a sub fuction and what is the maximum limit of subscripts that the character array can hold as an argument in a function...

Member Avatar for Ancient Dragon
0
92
Member Avatar for vbcielle

Can anyone help me...i have a file modt.txt and i want to save the content in modt2.txt but it seems my code is not working. Moreover, if i have the content of the 1st file Have a nice day. i want to save it to the 2nd file without double …

Member Avatar for vbcielle
0
165
Member Avatar for jfinch99

I have a homework assignment that requires that I sort an array of Accounts that contains strings for ID, PIN, and balance. I believe that I need to sort the array based on the ID. And then I have to verify the ID that the user inputs to the accounts …

Member Avatar for jfinch99
0
87
Member Avatar for shermaine

Hi, I have got this question: Write function of bitcount() that return the number of bits set to 1 in an unsigned integer. Here's my try: #include <stdio.h> int bitcount(unsigned x) main() { int b; for (B=0; x!=0; x >>=1) if (x &01) btt return b; } When i compile, …

Member Avatar for shermaine
0
120
Member Avatar for shermaine

May i know how to write this program. Write a function bigger() that returns bigger vaule in a signed integer array. Array and size are passed as arugements. Write a main program that inputs Max values from the keyboard into siged integer array,array and prints using biggest(), the biggest vaule …

Member Avatar for Ancient Dragon
0
272
Member Avatar for shermaine

attached is the q of the c program....and here's what i try to write out... may i know how should i write to prompt user to enter the four weights from the keyboard. and the program should print an error message if the weights are out of range? Here's my …

Member Avatar for Ancient Dragon
0
117
Member Avatar for saqib

hello guys i am new in this forum and in programing i want to write a program which could convert given temperature and its unit into oher scales please give me some sugestions and ideas bout that and i need to know how to declear chareters and how to take …

Member Avatar for saqib
0
313
Member Avatar for jan1024188

can anyone please send me a simple graphcal program written i C. i found this but it doesnt work [CODE]/* Simple program to illustrate use of a dialog box */ main() { /* Define default values: */ int n = 0; float x = 0.0; /* Define contents of dialog …

Member Avatar for andor
0
108

The End.