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
~538 People Reached
Favorite Forums
Favorite Tags
c x 5
c++ x 1
Member Avatar for SammyHasibi

[6 #include <stdio.h> 7 int main () 8 /* Declare and initialize variables. */ 9 int number1 = 4, number2 = 7, sum; 10 /* Calculate sum. */ 11 sum = numberl + number2; 12 /* Print the sum. */ 13 printf("The sum is */.d \n", sum); 14 /* Exit …

Member Avatar for Salem
0
100
Member Avatar for SammyHasibi

[code]#include <stdio.h> int function1(int a) { return(a*a*a); } int function2(int b) { int i; int sum = 0; for (i=1; i<=b; i++) sum += function1(i); return(sum); } int main () { int n, result; printf("Enter n\n"); scanf("%d", &n); result = function2(n); printf("Result = %d\n", result); system("pause"); return(0); } [/code] Explain …

Member Avatar for SammyHasibi
0
100
Member Avatar for SammyHasibi

I have written a program with 2 functions which compute factorials & combinations. The functions work perfectly when called but I cannot insert a for loop at the end which sums up the combos. This part works (I have omitted the functions because they work when called for). [code]long factorial(int …

Member Avatar for SammyHasibi
0
92
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
246