kλletaa
What language do you need to write it in
klimi
But I won't provide you solution is that alright?
klimi
I will lead you to one
klimi
So
klimi
Language is c++?
ankit
Yess
klimi
Okay
klimi
So let's assume we have already 4 integers, a,b,c,d.
klimi
How do we write things out into console?
ankit
Int a,b,c,d;
klimi
Int a,b,c,d;
... If I want to print "Hello world!" What should I do?
ankit
@ankit020
Is it possible to write in c?
ankit
Yes
Then can we intialize like int a,b,c,d ;
ankit
Right ?
klimi
Okay we have that
ankit
klimi
Let's assume we already have the values we need stored in those variables. How do we print it to console?
klimi
Just listen to me. I will guide you....
klimi
We will create blocks and later we will connect those blocks in order to make the program
klimi
So
klimi
How do we print out for example "hello world"?
ankit
Print("hello world");
klimi
So if we have the result stored in int result; how would we print it?
Vladimir
How do we print out for example "hello world"?
write(1, "hello world", 12); (sorry)
ankit
So if we have the result stored in int result; how would we print it?
You are giving "int" and want to o/p in charecter "hello world" Will this give any error.
ankit
?
klimi
No.
klimi
Just I have int result. And I want to print it out
klimi
No
klimi
I want to print the number
klimi
For example int result = 8; And the output should be : 8
Beer WRLD
ASCII value ??
Output the result value
Beer WRLD
Output the result value
A thing which is result or where u have stored the result
ankit
For example int result = 8; And the output should be : 8
Int results =8; Printf("%d, result):
ankit
Int results =8; Printf("%d, result);
klimi
Well done
klimi
How we will construct the math formula
klimi
A*20-b*2+c/d
ankit
Well done
😊😊
klimi
This is just taken from the picture you sent
klimi
So we can use this in our computation.
Vladimir
Better end out with \n
ankit
So we can use this in our computation.
Yes this will be use as a formula
klimi
int result = (a*20)-(b*2)+(c/d);
klimi
Is this right ?
ankit
klimi
Why we used bracket?
I just like the way it looks...
klimi
And I'm not sure if c++ does */ before +-
klimi
With () its 100%
ankit
With () its 100%
Then this will be fine
klimi
Okay
klimi
And now
klimi
The arguments
klimi
If we take look at the example
klimi
The executable is called with arguments (a,b,c,d)
klimi
Calculate 1 2 3 4
klimi
1 2 3 4 are arguments
ankit
int result = (a*20)-(b*2)+(c/d);
(1*20)-(2*2)+(3/4)...?
klimi
(1*20)-(2*2)+(3/4)...?
That would be if you put those there
ankit
Will this work something like this .
klimi
int main ( int argc, char *argv[] )
klimi
int main ( int argc, char *argv[] )
Definition of main looks something like this
klimi
This function main takes some arguments... Int argc and array chars argv
klimi
argc stands for - arguments count (number how much arguments we are given) argv are the values
ankit
#include <stdio.h> int main ( int argc, char *argv[] ) { } return 0;