User Profile
Collapse
-
no algorithim just have to figure out that what to put -
Reversing elements in an array
Problem:
Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the second with the next to the last, and so on, all the way to the middle of the array.
Given an array a , an int variable n containing the number of elements in a , and two other int variables, k and temp , write a loop that reverses the elements of the array.
Do not use... -
-
-
Need help with a print statement using arrays and structs
...Code:int search(student_record db[], int count) { int i; char fname[30], lname[30]; printf("Enter the employees first name:\n"); scanf("%s",fname); printf("Enter the employees last name:\n"); scanf("%s",lname); printf("\n\n"); for(i=0; i<count; i++) { if((strcmp(fname,db[i].firstname)==0) && (st -
-
-
Reading data in from a file
I am trying to read data in to a struct from a prototype
My Code is:
...Code:void init(student_record db[],int *count) { FILE *input; char temp_str[30]; input = fopen("mydata.txt","r"); while(!feof(input) && count<SIZE) { fscanf_s(input,"%s",temp_str); strcpy_s(db[*count].firstname,temp_str); fscanf_s(input,"%s",temp_str); -
Arrays
Hi I have a question from ab ook im trying to understand but can't get it. If someone can shoot me in the right direction i would appreciate it.
The question is:
Assume that ip has been declared to be a pointer to int and that result has been declared to be an array of 100 elements. Assume further that ip has been initialized to point to an element in the first half of the array.
Write an expression whose... -
-
I got this but I do now know hwo to return the answer true or false i know its 1 or 0
int isEven(int x);
{
if (x % 2 == 0){return 1;}
else {return 0;}
}Leave a comment:
-
Easy True False Equation
Write the definition of a function isEven , which receives an integer parameter and returns true if the parameter's value is even, and false otherwise.
So if the parameter's value is 7 or 93 or 11 the function returns false. But if the parameter's value is 44 or 126 or 7778 the function returns true. -
nevermind figured it out just used al oop statement and had it cal main()Leave a comment:
-
How to have program re run?
say i ask in the program
Would you like to do another calculation for another employee (enter y or n)?
how do i do this so that it re runs the program? -
-
-
awesome
...Code:#include <stdio.h> double get_input(); /* prototype to get the input from the user */ double calculate(); /* prototype to calculate the deggres into celsius */ void output(double); /* prototype to give the output */ double get_input() { double fahrenheit; printf("Enter the degrees in Fahrenheit:"); scanf_s(" %lf",Leave a comment:
-
when ran like that i get this error in my compiler
1>------ Build started: Project: Celsisu2a, Configuration: Debug Win32 ------
1>Compiling...
1>Celsius 2.c
1>f:\documents\ visual studio\celsius 2\celsius 2\celsius 2.c(43) : error C2198: 'calculate' : too few arguments for call
1>Build log was saved at "file://f:\Documents\Vi sual Studio\Celsisu2 a\Celsisu2a\Deb ug\BuildLog.htm "...Leave a comment:
-
-
Well I didn't try taht yet but I did try this and it works one problem though on my compiler for some reason it asks for degrees in farenheit 3 times before working any ideas here the code:
...Code:/******************************************************************************** Name:Andrew Lichenstein Program:Celsius2.c SS#:0287 Total Points:50 Due:09/13/2006
Leave a comment:
No activity results to display
Show More
Leave a comment: