Write a Program which Generates One Hundred Random Integers in the Range of 1 To
100, store them in an array and then prints the average. write three versions of the
program using Different Loop Constructs (e.g for, while and do. while).
Using For Loop
#include
#include
#include
void main()
{
int...
Read full history - Generate 100 Random numbers and print their average
Saturday, November 5, 2011
Generate 100 Random numbers and print their average
Free Download Turbo C for Windows 7 64 bit,32 bit And Windows Vista

Windows vista and windows 7 are both popular operating system, but when we compare this operating system with windows XP some of the basic operations/software which we use in XP won’t support in Vista or windows 7 operating system. For example command...
Tuesday, November 1, 2011
Find whether a given number is Strong or not
Write a program in C to find whether a given number is Strong or not
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int sof=0,n,dn,ctr,prod,rem;
clrscr();
printf("Enter the number\n");
scanf("%d",&n);
dn=n;
while(n!=0)
{
prod=1,ctr=1;
rem=n%10;
while(ctr<=rem)
{
prod=prod*ctr;
ctr=ctr+1;
}
sof=sof+prod;
n=n/10;
}
if(sof==dn)
{
printf("The...
Monday, October 31, 2011
Sorting the String in Dictionary order
Given an Array of Strings Write a Program to Sort the String in Dictionary Order.
Program:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[25][25],t[25];
int i,j ,n;
clrscr();
printf("enter the limit\n");
scanf("%d",&n);
printf("enter the elements:\n");
for(i=0;i<n;i++)
scanf("%s",&a[i]);
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(strcmp(a[i],a[j])>0)
{
strcpy(t,a[i]);
strcpy(a[i],a[j]);
strcpy(a[j],t);
}
}
}
printf("the...
Sunday, October 30, 2011
String palindrome program in C (without string function )
Write a Program to find whether the Given String is Palindrome or not without using
string functions.
#include<stdio.h>
#include<conio.h>
void main()
{
char s1[20];
int i,j,len=0,flag=0;
clrscr();
printf ("Enter a string:");
gets(s1);for(i=0;s1[i]!='\0';i++)
len++;
i=0;
j=len-1;
while(i<len)
{
if(s1[i]!=s1[j])
{
flag=1;
break;
}
i++;
j--;
}
if(flag==0)
printf("\nstring...
Saturday, October 8, 2011
C program to find Compound Interest using functions

Write a program to display Compound Interest for a given principal amount for 1 yr. Use function to find the interest....
Program..
#include<stdio.h>
#include<conio.h>
float ci(int p,float r);
void main()
{
int p;
float r,i;
clrscr();
printf("Enter...
C program to check for Armstrong Number

Write a program in C to check whether the given number is Armstrong or not....
Program...
#include<stdio.h>
#include<conio.h>
void main()
{
int num,r,sum=0,temp;
clrscr();
printf("\nEnter a number:");
scanf("%d",&num);
temp=num;
while(num)
{
r=num%10;
num=num/10;
sum=sum+(r*r*r);
}
if(temp==sum)
printf("\n%d...
C Program to check for Palindrome Number

Write a program to check whether the given number is palindrome or not....
Program
#include<stdio.h>
#include<conio.h>
void main()
{
int num,r,sum=0,temp;
clrscr();
printf("\nEnter a number:");
scanf("%d",&num);
temp=num;
while(num)
{
r=num%10;
num=num/10;
sum=(sum*10)+r;
}
if(temp==sum)
printf("\n%d...
Wednesday, October 5, 2011
Sum of a given series

Write a program to compute the sum of the following series:
(1/1!)+(2/2!)+(3/3!)+..........................+(n/n!)
Program...
#include<stdio.h>
#include<conio.h>
float factorial(int n);
void main()
{
int l,i;
float sum=0.0;
clrscr();
printf("Enter...
Tuesday, October 4, 2011
Program to find the value of nCr

Write a program to find nCr....
Program:
#include<stdio.h>
#include<conio.h>
long int factorial(int n);
void main()
{
int n,r;
long int ncr;
clrscr();
l1:printf("Enter value of n and r to find the value of ncr(n>r)");
scanf("%d%d",&n,&r);
if(n<r)
{
printf("Enter...
Finding Factorial of a number [ using Recursion & Iteration ]

Write a program to find the factorial of a given number using recursion and iteration .....
Program:
Using recursion...
#include<stdio.h>
#include<conio.h>
long int recur_factorial(int n);
void main()
{
int n;
long int fact;
clrscr();
printf("Enter...
Prime number [ using for, while, do-while ]

Write a program to display prime nos between 1 to 10 [ using for, while and do-while loop ]
Program:
Using for loop.....
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,flag=0;
clrscr();
printf("Prime no between 1 and 10 are:\n");
for(i=1;i<=10;i++)
{
for(j=1;j<=i;j++)
{
if(i%j==0)
flag++;
}
if(flag==2)
printf("%d\n",i);
flag=0;
}
getch();
}
Using...
Fibonacci series using Functions and Arrays

Write a program to display Fibonacci series by writing the value to the main().... [using function & arrays]
Program:
#include<stdio.h>
#include<conio.h>
long int fibo(int n);
void main()
{
int l,i;
long int fibonacci[50];
clrscr();
printf("Enter...
Pattern 1

Write a program to print the following pattern:
(1,1) (1,2) (1,3)
(3,1) (3,2) (3,3)
(5,1) (5,2) (5,3)
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<6;i++)
{
for(j=1;j<4;j++)
{
if(i==2...
Monday, October 3, 2011
Arithmatic operation using Switch case

Write a program to perform addition, subtraction, multiplication, division by reading arithmetic operators using Switch case.....
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
char ch;
clrscr();
printf("Enter two...
Wednesday, August 3, 2011
First Program

// This is the basic and the first program taught , to display a set of lines on the output device.
#include<stdio.h>
void main ()
{
printf(" Hello World ");
printf("\n Welcome to GITAM " );
printf("\n Welcome to C Lab" );
}
OUTPUT:
Hello World
Welcome...
About Me
- Unknown