Code In Tech - The Ultimate World of Computer Technology

Tuesday 27 March 2012

C program to print following pattern of star

                                            *
                                            **
                                            ***
                                            ****
                                            *****

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main();
{
 int i,j;
 clrscr();
 for(i=1;i<=5;i++)
 {
  for(j=1;j<=5;j++)

C program to Find total numbers which are divided by 7

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 unsigned int i,sum=0,count=0;
 clrscr();
 printf("\nthey are divided by 7:");
 for(i=101;i<=900;i++)
 {

C progrm to Find maximum of three numbers

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,c;
 clrscr();
 printf("Enter number A:");
 scanf("%d",&a);
 printf("Enter number B:");
 scanf("%d",&b);

Sunday 25 March 2012

C program to Find volume of spehre

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 float pi=3.14,v,r;
 clrscr();
 printf("enter radius of spehre :");
 scanf("%f",&r);
 v=(float)4/3*pi*r*r*r;
 printf("volume of spehre is %f",v);
 getch();
}

C program to Find area and circumferance of circle

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#define pi 3.14
void main()
{
 float a,c,r;
 clrscr();
 printf("enter value of radius :");
 scanf("%f",&r);
 a=pi*r*r;

C program for swap two values

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,c;
 clrscr();
 printf("enter value for a :");
 scanf("%d",&a);
 printf("enter value for b :");
 scanf("%d",&b);

C program for arithmetic operation between two numbers

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,ans;
 clrscr();
 printf("enter a number :");
 scanf("%d",&a);
 printf("enter second number :");
 scanf("%d",&b);

C program to Find temperature in fehrenheit

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 float c,f;
 clrscr();
 printf("Enter temperature in celsius :");
 scanf("%f",&c);
 f=(1.8)*c+32;
 printf("Temperature in fehrenheit is : %f",f);
 getch();
}

Saturday 24 March 2012

C program to Find total positive and negative numbers out of less than 100 no using array

SOURCE CODE:
void main()
{
 int a[100],p=0,n=0,ne=0,z=0,i;
 clrscr();
 printf("Enter less than 100 no.");
 scanf("%d",&n);
 printf("enter diffrent %d no.",n);
 for(i=0;i<n;i++)
 {
  scanf("%d",&a[i]);

C program to Find 3*3 multiplication

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j,sum=0,k,a[3][3],b[3][3],c[3][3];
 clrscr();
 for(i=0;i<3;i++)
 {
  for(j=0;j<3;j++)
  {

C program to Find sum and avg of n numbers

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a[15],sum=0,i;
 float avg;
 clrscr();
 printf("Enter n number:");
 for(i=0;i<n;i++)
 {

C program to find total odd and even numbers using array

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a[15],even[15],odd[15],e=0,o=0,i;
 clrscr();
 printf("Enter 15 number:");
 for(i=0;i<15;i++)
 {
  scanf("%d",&a[i]);

C Program to list of prime numbers till n

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j,n,flag=0;
 clrscr();
 printf("Enter number:");
 scanf("%d",&n);
 for(i=3;i<n;i++)
 {

C Program to check whether the given number is Palindrome or not

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 long int n,temp,a,sum=0;
 clrscr();
 printf("Enter number:");
 scanf("%ld",&n);
 temp=n;
 while(n>0)

C program to check number is prime or not

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int n,i,flag;
 clrscr();
 printf("Enter No.");
 scanf("%d",&n);
 for(i=2;i<n;i++)
 {

C program to Find sum of 100 numbers

SOURCE CODE: 
#include<stdio.h>
#include<conio.h>
void main()
{
 int i,sum=0,count=0;
 clrscr();
 for(i=101;i<=200;i++)
 {
  if(i%7==0)
  {

C program to Find binary to decimal and vise versa

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 long int i,a,b,n=1,sum=0;
 clrscr();
 printf("Enter binary no.");
 scanf("%ld",&i);
 while(i>0)
 {

C program to demonstring switch statement using break statement

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b;
 char choice;
 float c;
 clrscr();
 printf("enter first number :");
 scanf("%d",&a);

C Program which asks day number and prints corresponding day name

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int day;
 clrscr();
 printf("enter day no. :");
 scanf("%d",&day);
 switch(day)
 {

C Program to Find the Maximum number

SOURCE CODE: 
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,c;
 clrscr();
 printf("Enter number A:");
 scanf("%d",&a);
 printf("Enter number B:");
 scanf("%d",&b);

C Program to Find the reverse alpahbet

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 char ch;
 clrscr();
 printf("enter alpahbet:");
 ch=getche();
 if(ch>=65 && ch<=90)
 {

C Program to Find the percentage

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 float c,e,m,t,p;
 clrscr();
 printf("enter marks of C.P.U. :");
 scanf("%f",&c);
 printf("enter marks of E.E.E. :");
 scanf("%f",&e);

C Program to Find the simple and compound interest

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
 float si,ci,p,r,n,a;
 clrscr();
 printf("Enter the value of principle amount:");
 scanf("%f",&p);
 printf("Enter  the  value  of interest rest:");

C Program to Display Various Colors using ASCII Codes

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,c,n=1;
clrscr();
while(n<=15)
{
printf("ENTER ANY NO:");
scanf("%d",&c);

C Program to Arrange the given Names in Alphabetical order using Array

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
 char name[40][100],temp[20];
 int i,j,n;
 clrscr();
 printf("Enter the total number of names\n");
 scanf("%d",&n);

C Program to Arrange the given Numbers in Descending order using Array

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],n,c,i,j;
clrscr();
printf("Enter the total number of values:");
scanf("%d",&n);
for(i=0;i<n;i++)
{

C Program to Find the Smallest Number from the given Numbers using Array

 SOURCE CODE:
 #include<stdio.h>
#include<conio.h>
void main()
{
 int a[5],n,i,small;
 clrscr();
 printf("Enter the total number of values:");
 scanf("%d",&n);
 for(i=0;i<n;i++)
 {

C Program to Find the Biggest and Smallest Number from the given Numbers using Array

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a[10],n,i,big,small;
 clrscr();
 printf("Enter the total number of values:");
scanf("%d",&n);
 for(i=0;i<n;i++)
 {

C Program to check whether the given string is Palindrome or not

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
 char str1[20],str2[20];
 int i;
 clrscr();
 printf("\nEnter the string....");


C Program for Matrix Multiplication using Array

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a[3][3],b[3][3],c[3][3],i,j,k;
 clrscr();
 printf("\nEnter the A matrix\n");

 for(i=0;i<3;i++)
  {