I have a simple C program with use round function. This is my simple code (save as main.c) : #include <stdio.h> #include <stdlib.h> #include <math.h> int main(int argc, char **argv) { float a, b; int c, d; a = 5.6; b = 5.3; c = round(a); d = round(b); printf("a=%2.2f , round = %i \n",
I get function fix in Matlab. fix(X) rounds the elements of X to the nearest integers towards zero. For example if we have data with value : X = [-1.9, -0.2, 3.4, 5.6, 7.0] When we use fix function with this data, so we get output : Y = [1.0000 0 3.0000 5.0000 7.0000] I
I have a module in fortran and I want to call that module from C. I use gfortran (as Fortran compiler) and gcc (as C compiler). I want to calling routines in fortran modules from C. We can solve this problem by compile our code to object file and use gcc to compile object as
I want create program with C/C++ with passing argument feature. We can input string, integer or float from this argument input. Create a file with name main.c and paste this code : /* * main.c * * Created on: Mar 24, 2011 * Author: toto */ #include <stdlib.h> #include <stdio.h> int main(int argc, char **argv)