Code In Tech - The Ultimate World of Computer Technology

Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

Monday, 23 April 2012

C Program to Display the Equivalent Memory Addresses for the given values using Array

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a[10],i,*p;
 clrscr();
 printf("\nEnter 10 Nombers:");

 for(i=0;i<10;i++)
  {
   scanf("%d",&a[i]);

Sunday, 22 April 2012

C program for compare two string

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
 int c,flag=0,i;
 char a[25],b[25];
 clrscr();
 printf("Enter first string\n");
 gets(a);

C program for replace character of string

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int i=0;
 char str[10],och,nch;
 clrscr();
 printf("Enter a string:");
 scanf("%s",str);
 flushall();

C program for combination of two string

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
 int i=0,j=0;
 char a[25],b[25];
 clrscr();
 printf("Enter first string\n");
 gets(a);

C program for 2d array replace by zero

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

C program to find average using array

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

C program to print following pattern of numbers

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

C program to find you got distiction or not

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 for swap two values without using any other value

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

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++)
 {