C Program Tutorial Class-13

in STEEM LENS19 hours ago

Image cover

Dear friends, today I have come to you with another post, I hope that through this video you will be able to learn how to calculate the number 1+2+3+........+N. I have shared the AC program with you and shown the result by running MD and giving input. I have shown how to calculate the result. I gave 12 as input and the result is 78. If you wish, you can run this program and I am sharing this program with you here.

#include<stdio.h>
int main()
{
int i, n, sum;
printf("Enter numbers: ");
scanf("%d", &n);
sum=0;
for(i=1; i<=n; i++)
sum = sum+i;
printf("Result is: %d", sum);
return 0;
}

You can copy it from here and run it online and see the results. I hope you liked my video post today and please let me know how you liked it and if you know anything, please let me know in the comments. Thank you to everyone from my side. Stay well everyone.

IPFS Video

Posted with Speem

Coin Marketplace

STEEM 0.06
TRX 0.29
JST 0.050
BTC 69046.77
ETH 2027.96
USDT 1.00
SBD 0.49