Telegramy
Articles
About
« Rev
@programminginc
1656
Fwd »
kλletaa
What language do you need to write it in
klimi
But I won't provide you solution is that alright?
ankit
But I won't provide you solution is that alright?
Okkk
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
So let's assume we have already 4 integers, a,b,c,d.
Yess
klimi
How do we write things out into console?
@ankit020
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?
klimi
Is it possible to write in c?
Yes
ankit
Yes
Then can we intialize like int a,b,c,d ;
ankit
Right ?
klimi
Then can we intialize like int a,b,c,d ;
Yes but
klimi
Okay we have that
ankit
Yes but
But?
klimi
Let's assume we already have the values we need stored in those variables. How do we print it to console?
ankit
Let's assume we already have the values we need stored in those variables. How do we print it to console?
First we take inputs right? By using scanf function
klimi
First we take inputs right? By using scanf function
No
klimi
Just listen to me. I will guide you....
ankit
Just listen to me. I will guide you....
Okk please
klimi
We will create blocks and later we will connect those blocks in order to make the program
klimi
So
ankit
We will create blocks and later we will connect those blocks in order to make the program
Okk ...
klimi
How do we print out for example "hello world"?
ankit
How do we print out for example "hello world"?
Using printf function
ankit
Print("hello world");
klimi
Using printf function
Okay nice
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)
klimi
write(1, "hello world", 12); (sorry)
Goob boi *pat pat*
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
ankit
Just I have int result. And I want to print it out
ASCII value ??
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
This is just taken from the picture you sent
Yess
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
int result = (a*20)-(b*2)+(c/d);
Why we used bracket?
klimi
Why we used bracket?
I just like the way it looks...
ankit
I just like the way it looks...
Okk ..no prob
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;
« Rev
@programminginc
1656
Fwd »