I am working on some code for a program that squares,sums and divides 3 numbers:

int num,sq,sumd;
int a;
int b;
int c;

printf ("Please enter a positive integer for a/n"); //input

	scanf ("%d", &a);

	printf ("Please enter a positive integer for b/n"); //input

	scanf ("%d", &b);

	printf ("Please enter a positive integer for c/n"); //input

	scanf ("%d", &c);

printf("the square of %d is %d",num,sq);
return 0;

	int num,sq,sumd;

	printf("number here");



	printf("sum here %d",sumd);

	return 0;


have not done the subtract yet? I also need a results!

Hye hi,
Actually you have not mentioned your problem clearly & exactly. According to me you need a help for program which add subtract and square three numbers ok.
So, for this your solution is here:you may define three different functions for that

int a,b,c,s,sqr,sub;

printf("Enter Three positive integer numbers: ");

void add(int x,int y,int z)
  int w;
  printf("Addition of three numbers is:   %d",w);

void squr(int x,int y, int z)
  printf("\n square of %d is: %d",x,x*x);
  printf("\n square of %d is: %d",y,y*y);
  printf("\n square of %d is: %d",z,z*z);

void sub(int x,int y,int z)
  int w;
  printf("\n Subtraction of three numbers is: %d", w);

if it is solved then ok otherwise mention your query clearly what exactly you need?

Sorry, my question was not clear the input is 3 numbers then you square each number sum them the divide by n. For example
1 5 3
1 25 9


1. take the first three numbers(which you have already done)
2. find their squares... a*a, b*b, c*c store them in the same variable
3. sum them, a+b+c
4. Divide by n

That simple... :)

This article has been dead for over six months. Start a new discussion instead.