A small program and input output by shahriar33

View this thread on steempeak.com
· @shahriar33 ·
$2.10
A small program and input output
![christopher-gower-m_HRfLhgABo-unsplash.jpg](https://cdn.steemitimages.com/DQmVW1uw2ESWpRaomRpjCEnhoXqNVQw191Y6sMhc5GZyUfK/christopher-gower-m_HRfLhgABo-unsplash.jpg)[](https://unsplash.com/photos/m_HRfLhgABo?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink)


Let's write a small program first. The problem is that we will add two digits 4 and 5 using the programming language. Here we will use the C program. 

You can think that to sum two small digits why should I write a large code? But you should also know that with the help of program coding a large number of calculations can be done within a second. Just like how your calculator works. 

Al kinds of digital devices don't understand our language, they only understand coding languages. 

Now, look at the below codings:
`1 #include<stdio.h> `
`2`
`3 int main ()`
`4  {`
`5    printf ("%d/n", 4 + 5)`
`6     return 0;`
`7  }`

Here the line 1: stdio.h is the header file that has been included. There are different types of header files in the coding world. This one works for the input and out. the word stdio stands for Standard input-output.

Line 2: is optional though. It's just for increasing the beauty of your coding😄

LIne 3: From here the main function has been started. When you will run the program in the compiler that time it will start functioning from here. It will take only integer numbers as input.

Line 5: Here the program is printing two digits. If you like to sum or subtract more digits at the same time individually then you have to write `printf("%d %d\n", 4+5, 5-4)` If you want to print any digit or number you always have to add %d
Again here printf works as output.

Line 6: The main function will always return 0 which means to end a program you always have to return 0 otherwise the program will not end and it will be an error.

To practice, you can try online compiler here [C Compiler](https://www.programiz.com/c-programming/online-compiler/)


Programing is really interesting. Just try at your home and see the fun. Thanks for reading my post.

Best regards
@shahriar33
👍  , , , , , , , ,
properties (23)
post_id95,893,061
authorshahriar33
permlinka-small-program-and-input-output
categoryhive-145160
json_metadata{"tags":["program","cprogram","c","globalsteem"],"users":["shahriar33"],"image":["https:\/\/cdn.steemitimages.com\/DQmVW1uw2ESWpRaomRpjCEnhoXqNVQw191Y6sMhc5GZyUfK\/christopher-gower-m_HRfLhgABo-unsplash.jpg"],"links":["https:\/\/unsplash.com\/photos\/m_HRfLhgABo?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink","https:\/\/www.programiz.com\/c-programming\/online-compiler\/"],"app":"steemit\/0.2","format":"markdown"}
created2021-11-29 05:20:27
last_update2021-11-29 05:20:27
depth0
children2
net_rshares3,842,063,888,175
last_payout2021-12-06 05:20:27
cashout_time1969-12-31 23:59:59
total_payout_value1.053 SBD
curator_payout_value1.051 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length2,088
author_reputation42,986,623,470,822
root_title"A small program and input output"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (9)
@mirzapalevi ·
thank you for sharing knowledge🙏🏻
properties (22)
post_id95,896,148
authormirzapalevi
permlinkr3bsol
categoryhive-145160
json_metadata{"app":"steemit\/0.2"}
created2021-11-29 08:53:09
last_update2021-11-29 08:53:09
depth1
children0
net_rshares0
last_payout2021-12-06 08:53:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length33
author_reputation295,876,934,952
root_title"A small program and input output"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@etiboy56 ·
I guess the saying practice make perfect is here now. Great post boss
properties (22)
post_id95,916,709
authoretiboy56
permlinkr3d78e
categoryhive-145160
json_metadata{"app":"steemit\/0.2"}
created2021-11-30 03:05:09
last_update2021-11-30 03:05:09
depth1
children0
net_rshares0
last_payout2021-12-07 03:05:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length69
author_reputation3,910,409,346,155
root_title"A small program and input output"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000