Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~5K People Reached
Favorite Forums
Favorite Tags
c x 38
Member Avatar for wollacott

N 10*N 100*N 1000* N 1 10 100 1000 2 20 200 2000 3 30 300 3000 4 40 400 4000 5 50 500 5000 6 60 600 6000 7 70 700 7000 8 80 800 8000 9 90 900 9000 10 100 1000 10000 Hi, [code=c] #include<stdio.h> int main() …

Member Avatar for Ancient Dragon
0
619
Member Avatar for wollacott

i need my program to read in a file reverse it then write the file out. i got the reverse correct but its not working.my errors are: n.c:12: warning: passing argument 1 of 'fopen' from incompatible pointer type n.c:21: warning: passing argument 1 of 'fopen' from incompatible pointer type n.c:22: …

Member Avatar for Miorfs
0
2K
Member Avatar for wollacott

the last for loop i declared it inside, which doesnt work as a c program its c++ i need to declare it out side how do i do that? [CODE] #include <stdio.h> #include <string.h> #include <ctype.h> // Our function declaration saying it takes one string pointer and returns one string …

Member Avatar for Narue
0
177
Member Avatar for wollacott

You will read in a file supplied from the commandline (filename.ext,) and write/overwrite out a file which will be called (filename.ext.mng.) This file will be essentially the same as the original file, but will have all characters on all lines the reverse of the original. For example: The original file …

Member Avatar for Aia
0
127
Member Avatar for wollacott

g.c:12: warning: passing argument 1 of 'fgets' from incompatible pointer type g.c:12: error: too few arguments to function 'fgets' g.c:14: error: 'sc' undeclared (first use in this function) g.c:14: error: (Each undeclared identifier is reported only once g.c:14: error: for each function it appears in.) [CODE] #include <stdio.h> #include <string.h> …

Member Avatar for jephthah
0
265
Member Avatar for wollacott

need help with my program. it keeps repeating (NULL) instead of preinting hello backwards. if remove ca[5] i get bus error. any help please on how to fix it. [CODE] #include <stdio.h> int main() { char ca[10]; ca[0] = 'H'; ca[1] = 'e'; ca[2] = 'l'; ca[3] = 'l'; ca[4] …

Member Avatar for Luckychap
0
86
Member Avatar for wollacott

[code=c] #include <stdio.h> #include<string.h> main() { FILE * myfileptr; // a pointer declared to the file stream. char sc; // a character which will be input from the file. // main code... myfileptr=fopen("words","r"); //open the file hopefully while((sc=getc(myfileptr))!=EOF) //get a char { if(sc)printf("%c",sc); //dump it to screen } printf("EOF\n"); } …

Member Avatar for Aia
0
214
Member Avatar for wollacott

does anyone know how to give the characters of a string numeric variables? so when i can print the numeric variables in decending order so the word is read backwards? for example hello h=1 e=2 l=3 l=4 0=5 olleh your help would be very appreciated, a snippet would be awesome, …

Member Avatar for Aia
0
114
Member Avatar for wollacott

can anyone help me make my program work. after it capitalize i want it to reverse the new string. something like palindrome. [CODE] #include<stdio.h> #include<ctype.h> #include<string.h> /*program begins here*/ int main() { /**/ char string[100]; char *ptr = string; /*shws the user what to do*/ printf("Enter string and use a …

Member Avatar for jephthah
0
144
Member Avatar for wollacott

can anyone help me convert my c program so it works on a linux system or mac? thank you. [CODE] #include<stdio.h> #include<math.h> #include<conio.h> #include<stdlib.h> int main() { int c; int a, b; char d; pov:system("cls"); printf("Enter the first number\n"); a=getch()-48; system("cls"); printf("Enter the function:\n"); d=getch(); system("cls"); printf("Enter the second number\n"); …

Member Avatar for jephthah
0
90
Member Avatar for wollacott

Write functions to: void clearscreen(void); /* Clears the screen for update, hint call system("clear") */ float calc(float num1,float num2,char operator); /* calculate the result of num1 operator num2 */ any other functions which you deem necessary. Write a main program which will display a title line centered at the top …

Member Avatar for jephthah
0
264
Member Avatar for wollacott

i have to create a calculator which i have but i cant get it to run yet. i keep getting "12: error: subscripted value is neither array nor pointer" i'll highlight it for you. if anyone can fix it please do thank you. [CODE=c] #include<math.h> #include<stdio.h> int main() { float …

Member Avatar for jephthah
0
120
Member Avatar for wollacott

ok i need to do a program that inputs a amount of characters. my program has to capitalize the first letter and and letter after a full stop. any ideas and hints how to do it?

Member Avatar for Dave Sinkula
0
77
Member Avatar for wollacott

[CODE] #include<stdio.h> main() { static int n=0, number=1; int fibi (int n, int number); printf ("Following are the first 40 Numbers of the Fibonacci Series:\n"); printf ("1 "); fib (n,number); } fib (int n, int number) { static int i=1; int fibo; if (i==40) { printf ("\ndone"); } else { …

Member Avatar for pokiri
0
94
Member Avatar for wollacott

ok this is my code so far i have to use " isprime" to calculate prime number how do i do thatand where do i put it.thank you [CODE] #include<stdio.h> main() { static int n=0, number=1; // static: so value is not lost int fibi (int n, int number); printf …

Member Avatar for wollacott
0
200
Member Avatar for wollacott

can anyone help me? Write functions to: int isprime(int); /* Returns a true value if a is a prime number */ int nextFib(); /* Returns the next fibonacci value (use static variables to track which one was used last call) */ The fibonacci sequence is defined as: Fib(0)=1 Fib(1)=1 Fib(2)=Fib(1)+Fib(0) …

Member Avatar for DangerDev
0
74
Member Avatar for wollacott

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) { …

Member Avatar for ithelp
0
103
Member Avatar for wollacott

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 …

Member Avatar for jephthah
0
126
Member Avatar for wollacott

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; …

Member Avatar for Aia
0
112
Member Avatar for wollacott

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 …

Member Avatar for VernonDozier
0
138
Member Avatar for wollacott

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 …

Member Avatar for WaltP
0
275
Member Avatar for wollacott

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 …

Member Avatar for Duoas
0
95
Member Avatar for wollacott

enter 5 digit number s and have them display in single digits,using division and the remainder mod. This is what i have so far but it doesnt seem to work. #include <stdio.h> int main() { int num1,num2,num3,num4,num5,number; printf("enter five digit number"); scanf("%d,%d,%d,%d,%d",&num1,&num2,&num3,&num4,&num5); num1r=(number-(number%10000))/10000; num2=(number%10000-(number%1000))/1000; num3=(number%1000-(number%100))/100; num4=(number%100-(number%10))/10; num5=(number%10-(number%1))/1; printf("first number is …

Member Avatar for WaltP
0
93