C Program Tutorial Class-13
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.
Posted with Speem

#play