15,551 Topics
| |
For a school project I am doing we are required to take character input through the command line and convert the character to its ascii value. I would think, therefore, that the line of code: printf("%d",(int)argv[1]); would print out 97(ascii for a) if i were to type 'a' as the … | |
Hello, I need to write a program which displays some images on the screen depending on some calculations. For example if the result of the calculation is 3 it will display an image file, if it is 5 it will display another image file. I don't even know where to … | |
Hi... Does anyone know how can we get motherboard details using a c program for a Mac machine ? I want details like Motherboard Manufacturer, Its Model No., Its version and Serial Number. How can this information be obtained ?? | |
Could you please help me? what is wrong with this code? it prints only D->D->D->D (I want A->B->C->D) [code=c++] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h> struct node /* Declaration of structure "node" */ { char letter[1]; struct node *next ; }; struct node *start = NULL; main(void) { … | |
The question goes like this: You are given a file in which each line contains a list of space separated words. Write a program to find out: 1. List of words that are present in all the lines (words common to all lines) 2. List of unique words that are … | |
write a bit of code to read from a file and compare a string but it dies before it finishes. the complier tells me there is a segment fault on line 31 can anyone help. [CODE] [LIST=1] [*]#include <stdio.h> [*]#include <string.h> [*]#include <stdlib.h> [*]#define max 100 [*]struct customer{ [*] [*] … | |
I want to store a byte from fread as type char, and then be able to perform comparison operations on that byte as an int. I have [quote] int num; char buffer; num = fread(buffer, 1, 1, myFP); [/quote] and I'm sure it's not right. | |
I'm trying to make a program that converts octal numbers to decimal numbers. I know the concept is taking the %10 of the number to get the first digit, /10 the number then take the %10 to get the second digit and multiplying by increase powers of 8, but I … | |
i need a sample program for handling text files using c language.. i don't know the syntaxes.. please help me and provide some comments on the source code so that i'll be on track.. Things that i need: 1) How to locate the text file 2) How to input values … | |
my program stops right before the while loop [CODE] #include <stdio.h> int main() { int pay_type_1; int overtime; int num; float commissionsale; float payperitem; float salary; float hourrate; const float commissionrate=0.057; const float commissionpay=250; const float overtimerate=1.5; printf("paytype1=Managers salary\n"); printf("paytype2=hourly worker\n"); printf("paytype3=commision worker\n"); printf("paytype4=piece worker\n"); while (pay_type_1 > 0) { … | |
I'm better at C++ than C right now and I forgot how to use arrays in functions from main. I want to do something like [quote]void fileReader(infile[] ); [/quote]. Is infile supposed to be a pointer and if so how is it written? | |
hi everybody there......i want to access the addresses other than provided to me c compiler......can anybody help | |
hi I'm doing a banking project using binary files I need to write into a binary file and read and calculate the amounts within it. I open a file by asking the user for their name and searching and a file. I am having trouble reading the integers into a … | |
Need to work on an assignment in C for the following. 1. Changing the size of the cursor 2. Placing the cursor at an appropriate position on screen. 3. Drawing any graphics shape on the screen 4. Receiving a key from the keyboard 5. Checking the memory size of the … | |
Hello, Hi I Need To Flip The Bits In An Integer (not Toggle Them But To Actually Get A Mirror Image With Respect To Bit Positions). The Problem Is That I Am Taking An Input Data In Integer Form From A System But It Places The Msb At 0th Position … | |
A company pays its employees as managers (who recieve a fixed weekly salary), hourly workers (who recieve a fixed hourly wage for up to the first 40 hours they work and "time- and a half"-1.5 times their hourly wage-for overtime hours worked), commission workes (who recieve $250 plus 5.7% of … | |
I'm trying to make a program that asks the user what he/she wants to do, but when invalid inputs are entered, the program does not tell the user right away. Also, the sentinel value does not work. Thanks. [code] #include <stdio.h> int main () { int selection; float sum, difference, … | |
Hello everyone! I have a specific C question that I have not been able to solve. How do you count the number of particular numbers inside an integer variable? For example: int variable; The user inputs 22222 into the variable. The program displays "You entered five twos". How do you … | |
Hi to all viewers and members! can anybody help me or gave me any idea about parallel port interfacing that accepts input from a switch instead of keyboard and that input will be displayed in a seven segment.just a sample c program that has an input(inport) and ouput(outport) through the … | |
hi I have to made a program which read all blocks of hard disk and after reading give me hard disk capacity and its bad block i C language. Kindly tell me how can i read hard disk blocks and how i can know this block is bad or ok … | |
Can one of you geniuses out there help me please. They say that compiling and running hello world is the hardest bit. They're right. I've got debian on my laptop. I read a so-called tutorial that reccomended gcc hw.c OK. So I get a file called a.out. Allegedly an executable. … | |
can anyone help me finish my program please. thank you [code=c] #include <stdio.h> #include <math.h> int main() { int product; float product1 = 2.98; float product2 = 4.50; float product3 = 9.98; float product4 = 4.49; float product5 = 6.87; float quantity = 1; double unitprice; float result; double total; … | |
[code=c] //* By peter blatcher *// #include <stdlib.h>; #include <stdio.h>; #include <math.h>; float trap(float b, float Xo, int n); float integ(float X); int main() { float Va, Ve, difference, n, area, Fao, kCao, y, X, a, b; char c = n; n = 2; Fao = 0.4; a = 0.8; … | |
Hi I'm adapting some code I've written using 2d arrays (to represent matrices) to handle large arrays such that double matrix[][] goes to double **matrix and then I'm using malloc. It seems to work fine for part of my program up to where I have to find the matrix transpose … | |
Please dont do that | |
Please see the attchments | |
Please see the attchment for the assignment. Please help me !!!!!!!!!!!!!!!! | |
Hi, I have written a program that copies one file to another while making format changes to some lines The relevant part of the code is the following" [code] while(fgets (cbuff, 80, f1)!= NULL) { if ( (isdigit(cbuff[5])) && (isdigit(cbuff[11])) && (isdigit(cbuff[17])) ) { strncpy (c1, cbuff+1, 5); c1[5] = … | |
[CODE] Struct threshold { long value; int exponent; }t1,t2; t1.value = 2; t1.exponent =3; t2.value = 3; t2.exponent =4; [/CODE] The first structure (t1) is 2 x 10^3 The second structure (t2) is 3 x 10^4 I want to get the result after division of the two structures. The Reault … | |
I need to print out a number that begins with 7, without the seven. For example, print 71011 as 1011 or 701 as 01. I've tried many techniques and just can't get it to work. Is there a printf format that will let me print out everything left of the … |
The End.