how do I set the value of x to 2 and y to 3?


here is my code so far

#include <stdio.h>
int main(void)
{
	int x;
	int y;

	printf( "%d", x );


	return 0;
}

thanks for any help.

Welcome pyro_junky,
Ask your C-Language question in C forum.
Assignment operator = is used to set/assign a value to the variable.

x=2;
y=3;

oh sorry I thought I was using c++ lol. I'm really new at this :p

thanks for the help!

how do I set the value of x to 2 and y to 3?


here is my code so far

#include <stdio.h>
int main(void)
{
	int x=2;
	int y=3;

	printf( "%d", x );


	return 0;
}

this prgm has x=2 n y=3 n wil print value of x that is 2.

thanku

Comments
you're welcome

code:

#include<stdio.h>

int main(void)
clrscr;

{
int x=2;
int y=3;

printf("%d"x);
printf("%d"y);

}


output:

x=2
y=3

Comments
failcode

ADITI_89_SHARMA & nope3d,

Welcome to the daniweb.

Please read the following articles. These articles will help you to understand the rule at daniweb and also how to post?

1. Homework policy
2. How to post source code?
3. Title of thread must reflect your question.
4. Don't put any unnecessary comment to the thread.

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