#include <stdio.h>
#include <conio.h>
main()
{
int a, b;
printf("Enter To Numbers: ");
scanf("%d%d", &a, &b);
//swaping
a=a+b;
b=a-b;
a=a-b;
printf("%d %d", a, b);
getch();
}
#include<stdio.h>
#include<conio.h>
int main()
{
char ch;
printf("Enter a chararcter: ");
ch=getche();
printf("\nThe ASCII Code for \%c is %d",ch,ch);
getch();
}
#include<stdio.h>
#include<conio.h>
int main()
{
float r,v,area;
printf("Enter the radius of the sphere\n ");
scanf("%f", &r);
area=4*3.14*r*r*r;
v=(4/3.14)*3.14*r*r*r;
printf("volume of the sphere=%f\n", v);
printf("area of sphere=%f\n", area);
getch();
}
#include<stdio.h>
#include<conio.h>
int main()
{
float circumference,pie,r;
pie=3.14;
r=5;
circumference=2*pie*r;
printf("print the circumference of circle");
printf(" circumference is %f",circumference);
getch();
}
Note: This program is compiled in Turbo C.
#include <stdio.h>
#include <conio.h>
#include <dos.h>
int a;
void main ()
{
clrscr();
for(a=1; a<29; a++)
{
gotoxy(a,13); //goto coordinates (x, y) and print
delay(100); //stay for a moment
textcolor(a);
cprintf(" allclanguageprograms.blogspot.com");
}
for(a=65; a>27; a--)
{
gotoxy(a,13); //goto coordinates (x, y) and print
delay(50); //stay for a moment
textcolor(a);
cprintf("allclanguageprograms.blogspot.com");
}
getch();
}