how can i solve this equation in consol C# please i have a quiz and i need the answer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how can i solve this equation in consol C# please i have a quiz and i need the answer

z=(2*x) + y

19th Nov 2016, 8:30 PM
Rana Ahmed
Rana Ahmed - avatar
14 Answers
+ 2
public static void Main(String[] args){ double Z = equation(any value, any value); Console.WriteLine("result: "+ Z); Console.ReadKey(); } public static double equation(double x, double y){ return ( 2 * x ) + y; }
20th Nov 2016, 12:17 PM
Ousmane Diaw
+ 1
are you sure
19th Nov 2016, 9:31 PM
Rana Ahmed
Rana Ahmed - avatar
+ 1
ok but i want to ask you question
19th Nov 2016, 9:44 PM
Rana Ahmed
Rana Ahmed - avatar
0
well, I just typed it without codeblocksuor Devcpp so I'm not sure 100% but I think it's correct
19th Nov 2016, 9:34 PM
Mohamed Ouadjih
0
and u can add another variable E=2*x to get: z=E+y
19th Nov 2016, 9:35 PM
Mohamed Ouadjih
0
yes !
19th Nov 2016, 9:50 PM
Mohamed Ouadjih
0
when i write my program the black window deosnt appear why
19th Nov 2016, 10:05 PM
Rana Ahmed
Rana Ahmed - avatar
0
what black window 0.o
19th Nov 2016, 10:07 PM
Mohamed Ouadjih
0
what programme do you use
19th Nov 2016, 10:08 PM
Mohamed Ouadjih
0
visual studio consol c#
19th Nov 2016, 10:09 PM
Rana Ahmed
Rana Ahmed - avatar
0
when i make run for my program the output deosnt appear
19th Nov 2016, 10:10 PM
Rana Ahmed
Rana Ahmed - avatar
- 1
I didn't use this program before I suggest you to download codeblocks and work it's clear then visual studio... type in YouTube :how's to download codeblocks and install bcz there is some tips to make it work with the compiler...
19th Nov 2016, 10:13 PM
Mohamed Ouadjih
- 1
your problem with the compiler then just type how to solve compiler issue in virtual studio
19th Nov 2016, 10:14 PM
Mohamed Ouadjih
- 3
main() {float x,y; printf ("give x"); scanf ("%f",&x); printf ("give y"); scanf ("%f",&y); printf ("z=%f,((2*x)+y)); system ("pause"); }
19th Nov 2016, 9:25 PM
Mohamed Ouadjih