15,552 Topics
| |
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 … | |
I need to write something like this, just plain and simple c. 1. Program starts and prints 5 news titles 2. You select one and it prints news body 3. after viewing you select close and select other one or exit program 4. after that it prints "sort by views" … | |
Hi, I'm new here, so please be gentle :) For an application I'm working on I need to implement a callback function that takes a va_list as an argument. Inside that function, however, I need to pass the va_list (or rather all arguments of the callback function) to a function … | |
I'm using Linux and I'm trying to send mail using C but I'm not sure if my code works: s_Mail[999] = "mailx -r \"Sender\" -R \"Recipient\" -s \"Subject\" -F \"Message\""; mail(s_Mail); This is the part that sends the mail...the -F for the message part is really hazy... | |
My question is to calculate the mean of a comma separated dataset stored in a file. The program will be run on a system with no floating point library. Obey the following rules: 1.Maximum 100 values in dataset 2.Each data entry in the dataset is a byte (0 - 255) … | |
Hello i have spent hours and days and couldn't find how i can make a variable that has rounded to 2 decimal digits. But i dont want to use myVariable.value....or myVariable()....styles. In the net i have seen something like BCD that is related for official accounting issues but i coudn't … | |
so here's the code. [CODE]#include<stdio.h> #include<conio.h> void main() {struct { char seat; }a[19]; int x,z; char y; a[0].seat='A'; a[1].seat='B'; a[2].seat='C'; a[3].seat='D'; a[4].seat='A'; a[5].seat='B'; a[6].seat='C'; a[7].seat='D'; a[8].seat='A'; a[9].seat='B'; a[10].seat='C'; a[11].seat='D'; a[12].seat='A'; a[13].seat='B'; a[14].seat='C'; a[15].seat='D'; a[16].seat='A'; a[17].seat='B'; a[18].seat='C'; a[19].seat='D'; clrscr(); printf("Flight Seat Reservation:"); printf("\n\n\n\t1\t%c\t%c\t%c\t%c", a[0].seat, a[1].seat, a[2].seat, a[3].seat); printf("\n\t2\t%c\t%c\t%c\t%c", a[4].seat, a[5].seat, a[6].seat, … | |
[code=c] int main() { int a,b,c; a=b=c=1; c = ++a || ++b && ++c; printf("%d %d %d", a,b,c); } [/code] here the expression is considered from left to right. but the confusion of mine is: && has got higher precedence than that of ||. so ++b && ++c should be … | |
i am writing a pogram where i have to find out which all computers are up on my lan...for this i have called shell script program from my C code which pings to all computers on lan....now i want the shell script to return to the C code "1" incase … | |
[code=c] #include<stdio.h> #include<conio.h> void main() { float a=6; clrscr(); printf("%d",a); getch(); } [/code] here the output is some garbage value.here the error lies in %d instead of %f.for float value the identifier is f.is this the proper answer of my question? | |
WHO HAS ALGORITHMS OF PROBLEM : PLACE k<=8 QUEENS ON THE CHESSBOARD SO THAT THEY CONTROL (EXAMINE) ALL CELLS OF CHESSBOARD 8X8. THANKS! | |
Well, this is what we got for writing this holidays at school using plain C and the most simple methods. Any solutions available? Create program for defining hierarchical file-system structure in which node can be file or subdirectory with limitation that file can only be a leaf. Capabilities that program … | |
hi, i'm new in this site.. i'm working on a airplane seat reservation program.. we were asked to design a program that chooses the users' desired row number and the desired seat number (or rather in this case, seat letter)... here's my code [CODE]#include<stdio.h> #include<conio.h> #include<string.h> void main() { struct … | |
| Say I have an infinite loop, and I want to start over or terminate depending on what user inputs. [CODE] while( 1 ) // start the inifite loop { printf( "Enter your number: " ); // prompt scanf( "%d", &operand1 ); // store user entered number into operand1 if ( … |
Im creating a slot machine program and used the kbhit command to stop the reels. Right now im tryn to change how the program works instead of stoping it all at once i want the reels to stop one at a time (everytime a key is pressed one reel would … | |
ok people i wrote this code myself. i just need your help so this program can accept any digits and print the decimal equivalent. i worte more than i needed too because i wasnt so sure how muchi needed. i dont think it works very well. i tried 1101 and … | |
Input an integer containing only 0’s and 1’s( ie. “binary” integer) and print its decimal equivalent. {hint: use the remainder and division operators to pick off the binary numbers digits one at a time from right to left. Just as in the decimal number system, in which the right most … | |
Hello All! I am running AIX4.3 UNIX OS. I am developing using the C-Programming Language. I have inherited code which creates a dialog box. [code] dialog(box_height, box_width, position_x, position_y, "message")[/code] The requirement [B][I]now[/I][/B], is to place a list of say numbers in the box and grow it dynamically. Problem is, … | |
Hi ,i am creating some file and i need to open an exe file. Like this ,I creating preface application because installation of the game . So i need that when Computer finish the installation that he start another exe file who have nothing with my preface application. I using … | |
Hi, Is there any way so that I call mspaint through my C program and edit the resolution or resize my photos? Sundeep | |
i would like adding tow number by postfix when the inputs like : 5,7 then the out put: 57+ i hope there is recommendable code for that program | |
Hi , How can i get access to ( .rc)file when i already load it(already start my program). I want to make some changes from main window. Thank you for your effort of reading . | |
[code=c] #include <stdio.h> int main() { unsigned short i = 0; scanf("%u", &i); printf("%u", i); } /* int main() { unsigned short i = 0, j = 0; scanf("%u", &i); printf("%u", i); } */ [/code] hey try the above prog, cc short.c -o short then ./short enter a number, you … | |
/stores and retrieves data for two secret asgents [code=c] #include<stdio.h> void main () { struct personnel { char name [30]; int agnumb; int agent; }; struct personnel agent1; struct personnel agent2; char numstr[81]; printf("\nagent 1.)\nEnter name:"); printf("Enter agent number (3 digits): "); gets(numstr); agent1.agnumb=atoi(numstr); gets(agent2.name); printf("Enter agent number (3 digits);"); … | |
This is a piece of code that I can't seem to get right. Hehe. I've initialized the string "sym" to have the values '0' and '0'. I then call the function "cnvrt" and use "sym" in the parameter(not so sure if that's the right term) of "cnvrt". Since strings are … | |
I bet the answer to my problem is hidden somewhere in these forums as this seems to be a fairly common question, yet after literally 2 days of searching for an answer I can't find it so please bare with me. What I'm trying to do here is to read … | |
Hello I'm doing a C project for College.It is a banking system where you take in customer name address etc, Print a statement based on a month by month bases.I need to use binary files I have two versions(well Attempts) of this project the one I'm having biggest trouble with … | |
I am trying to edit a string in c. I need to remove the last 84 characters from a string[400], insert text and re-insert the 84 character string at the end. No problem adding text or coping text in C, but I can't remember how to reorder/manipulate the text string. … |
The End.