C PROGRAMMING
رفتن به کانال در Telegram
اطلاعاتی وجود ندارد
مشترکین
-824 ساعت
-347 روز
+8830 روز
آرشیو پست ها
Program to add odd numbers from 1 to n using for loop.
----------------------------------------------------------
Program:
#include <stdio.h>
int main() {
int i,n,sum=0;
printf("Enter the value of n:");
scanf("%d",&n);
for(i=1; i<=n; i+=2)
{
printf("%d +%d =",sum,i);
sum=sum+i;
printf("%d\n",sum);
}
return 0;
}
----------------------------------------------------------
#basicprograms
Program to print odd numbers from 1 to n using while loop.
----------------------------------------------------------
Program:
#include<stdio.h>
int main()
{ int i=1,n;
printf("Enter the value of n:");
scanf("%d",&n);
while(i<=n)
{
printf("%d\n",i);
i=i+2;
}
return 0;
}
----------------------------------------------------------
#basicprograms
Program to add two numbers by accepting input from the user:
----------------------------------------------------
Program:
#include<stdio.h>
int main()
{
int a,b,sum;
printf("Enter two numbers:");
scanf("%d%d",&a,&b);
sum=a+b;
printf("sum of %d and %d is =%d",a,b,sum);
return 0;
}
----------------------------------------------------
#basicprogramsProgram to add two numbers
-------------------------------------------------
Program:
#include<stdio.h>
int main()
{ int a,b;
a=19;
b=35;
printf("Sum of %d and %d is =%d",a,b,a+b);
return 0;
}
-------------------------------------------------
#basicprograms
Program to print Hello World
---------------------------------------------------
Program:
#include<stdio.h>
int main()
{
printf("Hello world");
return 0;
}
---------------------------------------------------
#basicprograms
------------------------------
Introducing myself :
------------------------------
I'm also a student like you studying BCA 3rd year, I started this channel to share the knowledge of C programming .
I try to gather as much programs as I can and share them with you, hoping you will support the channel by sharing this channel with your friends who are aiming to practice programs.
Channel link is here👇
https://t.me/C_language_programing
If I make any mistakes in any program message me the mistake I had made so I'll try to correct them.
contact here 👇
@imabhi3030
