#include<stdio.h>#define MAX 1000
int main(){
char binaryNumber[MAX],hexaDecimal[MAX];
long int i=0;
printf("Enter any hexadecimal number: ");
scanf("%s",hexaDecimal);
Type: Posts; User: AFCKING
#include<stdio.h>#define MAX 1000
int main(){
char binaryNumber[MAX],hexaDecimal[MAX];
long int i=0;
printf("Enter any hexadecimal number: ");
scanf("%s",hexaDecimal);
Right! since it returns a negative value for difference I need to use the absolute value. Thanks. Haha it took me long enough to understand.
Yes I have that #include "stdlib.h" I didn't copied it
#include "stdio.h"float squareRoot(float number, float accuracy);
int main()
{
float a;
printf("\nsquare root test 1: enter a number\n");
scanf("%f",&a);
...
Yeah I got guys, thank you. I use the int* b = malloc(....) and it works, maybe should learn dynamic array again.
Hi, thanks for your input the missing bracket is the copying i miss it. When I take b[0] and b[1] out it still does not show, apparently it shows some weird number
// Fiboncacci Test---------------------------------
int n;
int* fib;
printf("\nFibonacci test 1: enter an integer\n");
scanf("%d",&n);
...
I asked what should I do as in give me some pointers so I could do them myself, right now I don't know where to start, what is the point of having forums to ask if you already have google. Google...
int main()
{
int n;
int* fib;
printf("\nFibonacci test 1: enter an integer\n");
scanf("%d",&n);
fib = fibonacci(n);
printf("fib(%d) = ", n);
for(int i = 0; i < n; ++i){
...
How do you add two matrices together ?
Yes it will loop until the array is over, but somehow it keeps returning 1 even though it is wrong.
int sorted( int a[], int b)
{
for(int c = 0; c < b - 1; ++c)
{
if(a[c]<a[c+1])
return 1;
else
return 0;
}
I think I got it, thanks!
something like this
float sumSquares(float a[], float b)
{
int c;
float total = 0;
for(c = 0; c < b; ++c)
{
total = a[c]*a[c] + total;
}
I don't know what to do, a tip to where to start or what to use would be nice. I am suppose to use the stdio and stdlib only.
Hey guys, I am suppose to do this but I am stuck, any help would be appreciated.
1 - Sum of Squares
Write a function called sumSquares that returns the sum of the squares of its float array...
Is there anyway we can return 2 values from a called function
example
float xxxx(float a, float b, float c, float d)
{///
///
///
}
void a2question2(float *n1, float *n2, float *n3){
int i;
for(i=1; i <= 3; ++i)
{
printf("Enter %d%s", i, i == 1 ? "st", i == 2 ? "nd" : "rd");
scanf("%f", i == 1 ? n1...
float three_numbers(float num1, float num2, float num3){
printf("Sum = %.0f\n", num1+num2+num3);
printf("Average = %.2f\n", (num1+num2+num3)/3);
printf("Product = %.0f\n",num1*num2*num3);
}...
I found this code
#include<stdio.h>
#include<conio.h>
void main()
{
int n,big,sml,i,totalNumber;
clrscr();
printf("\n How many number you will enter : ");
scanf("%d",&totalNumber);
for...
I was reading another thread; http://cboard.cprogramming.com/c-programming/124905-determine-largest-smallest-three-integers.html, and there is a guy suggested using swap() so I look it up on the...
I already have a working code, but it does not look aesthetic due to using too many if() and else if(), I am learning it by myself and right now I am reading on swap() which I think it can be used to...
Thanks!
Hi guys, is there anyway to have a program where it ask for three numbers and you shows which which number is the largest and which is the smallest, e.g.
Enter 1st number: 30
Enter 2nd number: 10...
Thanks, that was insightful. Somehow I still can't use it in my function, it will still give me the value for only 1 equation.