0

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.

5
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by Nick Evan
0

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;
0

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

thanks for the help!

-1

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

Votes + Comments
you're welcome
-1

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

Votes + Comments
failcode
0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.