C programming examples with output
Swapping of two integers
Program
#incluede<stdio.h>
#include<conio.h>
main()
{
int a,b;
clrscr();
printf("Enter two numbers : ");
scanf("%d%d",&a,&b);
printf("\nValue of a : %d",a);
printf("\nValue of b : %d",b);
a=a+b;
b=a-b;
a=a-b;
printf("\nVAlue of a : %d",a);
printf("\nValue of b : %d",b);
getch();
}
Output
Enter two numbers:34
56
Value of a:34
Value of b:56
Value of a:56
Value of b:34
Check others programming by click here:
Factorial of a number:
Find sum of digits of a number:
Find vowel or not:
Palindrome Number:
Swapping of two integers
Program
#incluede<stdio.h>
#include<conio.h>
main()
{
int a,b;
clrscr();
printf("Enter two numbers : ");
scanf("%d%d",&a,&b);
printf("\nValue of a : %d",a);
printf("\nValue of b : %d",b);
a=a+b;
b=a-b;
a=a-b;
printf("\nVAlue of a : %d",a);
printf("\nValue of b : %d",b);
getch();
}
Output
Enter two numbers:34
56
Value of a:34
Value of b:56
Value of a:56
Value of b:34
Check others programming by click here:
Factorial of a number:
Find sum of digits of a number:
Find vowel or not:
Palindrome Number:
0 komentar:
Post a Comment