C Programming Codes
13.4K subscribers
139 photos
2 videos
12 links
C Programming Codes || Quizzes || DSA

Learn along with the community

Any queries
admin - @Pradeep_saii
Download Telegram
Process of execution of C program
👍13🔥4
This media is not supported in your browser
VIEW IN TELEGRAM
program to produce beep sound using C
👍214👎2
program to accept three numbers from the user and print them in ascending and descending order using if else if ladder
👍112
---------------------------------------------------------
Write a program to swap the values of two variables without using third variable
step 1-
a=a+b,the two values entered by user will be added and get stored in a
for ex: if user enter 30 and 10.
a=a+b
a=30+10
a=40.
step 2:
now the value of a is 40 and b is 10
b=a-b
b=40-10
b=30
step 3:
now the value of a is 40 and b is 30
a=a-b
a=40-30
a=10


now value of a=10,b=30
hence numbers got swapped
👍14
---------------------------------------------------------------
Write a program to calculate the area and perimeter of the circle
👍12
Program to print Hello World
---------------------------------------------------
Program:
#include<stdio.h>
int main()
{
printf("Hello world");
return 0;
}
---------------------------------------------------
#basicprograms
👍319🙏4
Program to print Hello World in double quotes.
---------------------------------------------------
Program:
#include<stdio.h>
int main()
{
   printf("\"Hello World\"");
    return 0;
}
---------------------------------------------------
#basicprograms
16👍11😁6💩1
Program to print a line in new line.
--------------------------------------------------------
Program:
#include<stdio.h>
int main()
{
   printf("Hello programmers\n");
   printf("Welcome this page\n");
   printf("follow this page\n");
   printf("too many programs will be provided\n");
   printf("In coming days");
   return 0;
}
--------------------------------------------------------
#basicprograms
22👍9💩3👎1
Program 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
👍169💩3
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;
}
----------------------------------------------------
#basicprograms
👍2210👎2💩1
Program to calculate area of triangle.
-----------------------------------------------------
Program:
#include<stdio.h>
int main()
{  float a,b,area;
    printf("Enter base and height of triangle:");
    scanf("%f%f",&a,&b);
    area=(a*b)/2;
    printf("Area=%.2f",area);
    return 0;
}
-----------------------------------------------------
#basicprograms
👍2915
Program to calculate area of triangle by Heron's formula:
--------------------------------------------------------
Program:
#include<stdio.h>
#include<math.h>
int main()
{ float a,b,c,s,area;
printf("Enter three sides of triangle:");
scanf("%f%f%f",&a,&b,&c);
s=(a+b+c)/2;
area=sqrt((s*(s-a)*(s-b)*(s-c)));
printf("Area is = %.2f",area);
return 0;
}
---------------------------------------------------------
#basicprograms
👍337