Beruflich Dokumente
Kultur Dokumente
lab(C)
RCC
INSTITUTE
OF
INFORMATION
TECHNOLOGY
ASSIGNMENTS
ON
PROGRAMMING
LAB(C)
DONE BY
HAREKRISHNA
PAL
ROLL:
06
DEPERTMENT: MCA
YEAR: FIRST
SEMESTER: 1st
GROUP: 1
1 Created
by
Krishna
Pal
Programming
lab(C)
CONTENTS
Sl.
No.
Assignment
Names
Date
of
Commencement
Date
of
Submission
Teacher�s
Signature
1.
Enter radius of a circle and find the
area and circumference.
___.___.2010 ___.___.2010
2. Find the largest of three numbers. ___.___.2010 ___.___.2010
3.
Enter a number and check whether it is
odd or even.
___.___.2010 ___.___.2010
4.
Write a programme to find the roots of a
Quadratic Equation. ___.___.2010 ___.___.2010
5.
Write a programme to find the sum of
natural numbers from 1 to a given
numbers.
___.___.2010 ___.___.2010
6.
Write a programme to find the factorial of
a number.
___.___.2010 ___.___.2010
7.
Write a programme to print the prime
numbers from 1 to a given numbers.
___.___.2010 ___.___.2010
8.
Write a programme to print the perfect
numbers from 1 to a given numbers. ___.___.2010 ___.___.2010
9.
Write a programme to print the Fibonacci
series: 1,1,2,3,5,8,13,..........N ___.___.2010 ___.___.2010
10.
Write a programme to enter some
numbers and find how many of them are
odd/even and find the average of odd
and even numbers.
___.___.2010 ___.___.2010
11.
Enter some numbers and find the
maximum and minimum without array.
___.___.2010 ___.___.2010
12
Write a programme to find the L.C.M.
and H.C.F of two given numbers.
___.___.2010 ___.___.2010
13.
Write a programme to find the GCD
using iteration and recursions function. ___.___.2010 ___.___.2010
14.
Write a programme to accept a number
and check whether it is Armstrong or not.
___.___.2010 ___.___.2010
15.
To find the sum of the digits of a given
number.
___.___.2010 ___.___.2010
16.
To print the palindrome numbers from
100 to 1000.
___.___.2010 ___.___.2010
17. S= 1 + X + X^3 + X^5 + .............N. ___.___.2010 ___.___.2010
18.
S= 1 + (1 + 2) + (1 + 2 + 3) + .........N.
___.___.2010 ___.___.2010
19.
S= 1+ 2/2! + 3/3! + 4/4! +......N.
___.___.2010 ___.___.2010
20. S= 1 + X + X^2 + X^3/3! + X^4/4! +.......N ___.___.2010 ___.___.2010
2 Created
by
Krishna
Pal
Programming
lab(C)
Sl.
No.
Assignment
Names
Date
of
Commencement
Date
of
Submission
Teacher�s
Signature
21. Sin X= X -X^3/3! + X^5/5! -X^7/7! +..N ___.___.2010 ___.___.2010
22.
Enter some numbers and store them in
an array, then enter a number and check
whether it exists in the array or not.
___.___.2010 ___.___.2010
23.
Enter some numbers and store them in
an array, now create two array of odd
and even numbers.
___.___.2010 ___.___.2010
24.
Write a programme to change a Decimal
numbers to Binary numbers.
___.___.2010 ___.___.2010
25.
Write a programme to change decimal
numbers to Octal and Hexadecimals.
___.___.2010 ___.___.2010
26.
Write a programme to change Binary
numbers to Decimals.
___.___.2010 ___.___.2010
27.
Write a programme to enter elements in
a 2D Array and display in Matrix from.
___.___.2010 ___.___.2010
28.
Write a programme to sort some
numbers using bubble sort and Selection
sort separately.
___.___.2010 ___.___.2010
29
Write a programme to find the sum of
each row in a 2D Array.
___.___.2010 ___.___.2010
30.
Write a programme to find the sum of
each column of a 2D Array.
___.___.2010 ___.___.2010
31.
Write a programme to find the sum of the
diagonals of a 2D Array.
___.___.2010 ___.___.2010
32.
Write a programme to find the sum and
multiplication of two matrices.
___.___.2010 ___.___.2010
33.
Write a programme to find the transpose
of a matrix.
___.___.2010 ___.___.2010
34.
Write a programme to accept a sentence
and find the number of words.
___.___.2010 ___.___.2010
35.
Write a programme to accept a word and
count the number of vowels.
___.___.2010 ___.___.2010
36.
Write a programme to accept a sentence
and find number of vowels, consonants,
numbers, spaces and special characters.
___.___.2010 ___.___.2010
37.
Write a programme to accept a word and
find the sum of its ASCII values.
___.___.2010 ___.___.2010
38.
Write a programme to accept a word and
print it in reverse forms.
___.___.2010 ___.___.2010
39.
Write a programme to accept a word and
check whether it is Palindrome or not.
___.___.2010 ___.___.2010
40.
Write a programme to accept a sentence
and find the occurrence of each
character.
___.___.2010 ___.___.2010
3 Created
by
Krishna
Pal
Programming
lab(C)
Sl.
No.
Assignment
Names
Date
of
Commencement
Date
of
Submission
Teacher�s
Signature
41.
Write a programme to accept a name of
person and print the 1st letter of the first
and middles (if any) and the title as it is in
examples: Raja Ram Das .
R. R. Das or
Rahul Ray .
R. Ray.
___.___.2010 ___.___.2010
42.
Write a programme to accept a string as
a command lone argument and then find
its length.
___.___.2010 ___.___.2010
43.
Write a programme to accept text from
keyboard and store them in a file and
then display the content of the saved file.
___.___.2010 ___.___.2010
44.
Write a programme to accept 10
students� names and marks of three
subjects then calculate the total marks
and store them in a file.
___.___.2010 ___.___.2010
4 Created
by
Krishna
Pal
Programming
lab(C)
.
1.
Enter
radius
of
a
circle
and
find
the
area
and
circumference.
.
####Definition : Given the radius of a circle, the area and circumference can be
calculated
using the formula. Area=pi*r*r and circumference=2*pi*r where, r is the radius of
the circle,
pi is approximately 3.142.
.
####Flow Chart :
INPUT r
Define
PI=3.142
a=PI*r*r
c=2*PI*r
PRINT a
PRINT c
STOP
START
5 Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
float r,a,c; /*Declaration of variable*/
clrscr(); /*Clear the console screen*/
.
####Output :
Enter the radius of circle: 2
6 Created
by
Krishna
Pal
Programming
lab(C)
.
2.
Find
the
largest
of
three
numbers.
.
####Definition : Given three values, checking and print the number which is largest
among
them.
.
####Flow Chart :
No No
Yes Yes
INPUT a, b, c
PRINT Max
STOP
START
Is
a>b and
a>c
Is
b>a and
b>c
Max=a Max=b Max=c
7 Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
int a,b,c,max; /* Declaration of variable */
clrscr(); /* Clear the console screen */
printf("\nEnter three numbers:\t");
scanf("%d%d%d",&a,&b,&c); /* read data from keyboard */
max=((a>b && a>c)?a:((b>a && b>c)?b:c)); /* calculating maximum */
printf("\nThe largest number is:\t%d",max); /* Printing maximum */
getch();
.
####Output :
Enter three numbers: 5
8
0
8 Created
by
Krishna
Pal
Programming
lab(C)
.
3.
Enter
a
number
and
check
whether
it
is
Odd
or
Even.
.
####Definition : This concept begins with integers. An even number is an integer
that is
"evenly divisible" by 2, i.e., divisible by 2 without remainder; an odd number is
an integer
that is not evenly divisible by 2.
.
####Flow Chart :
#0 =0
START
Input N
Is
N%2
Print EvenPrint Odd
STOP
9 Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
int n; /* Declaration of variable */
clrscr(); /* Clear the console screen */
printf("\nEnter the number:\t");
scanf("%d",&n); /* read data from keyboard */
if(n%2==0) /* checking for Odd/Even */
.
####Output :
Enter the number: 8
The given number[8] is: EVEN
10 Created
by
Krishna
Pal
Programming
lab(C)
.
4.
Write
a
programme
to
find
the
roots
of
Quadratic
Equations.
.
####Definition : A real number X will be called a solution or a root if it
satisfies the given
equation, meaning a*(X^2)+ b*X+ c=0.
.
####Flow Chart :
<0 >0
=0
START
Input a,b,c
Is d
STOP
Print r1.r2
d = (b*b)-(4*a*c)
r1=r2= � b/ (2*a)
d =d * ( -1)
temp=sqrt(d)
t1=-b/(2*a)
t2=temp/(2*a)
r1=t1+t2
r2=t1-t2
temp=sqrt(d)
r1=(-b+temp)/(2*a)
r2=(-b-temp)/(2*a)
11 Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
{
float a,b,c,d,temp,r1,r2; /* Declaration of variable */
clrscr(); /* Clear the console screen */
printf("\nEnter the value of a\t:");
scanf("%f",&a); /* read the values of a,b & c from keyboard */
printf("Enter the value of b\t:");
scanf("%f",&b);
printf("Enter the value of c\t:");
scanf("%f",&c);
if(d==0)
{
printf("\nRoots are real and equal\n");
r1=-b/(2*a);
printf("\tX1=%f\n\tX2=%f",r1,r1);
}
else if(d>0)
{
}
else
{
}
getch();
}
12 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
Enter the value of a :2
Enter the value of b :3
Enter the value of c :4
X1=(-0.750000 + 1.198958i)
X2=(-0.750000 -1.198958i)
X1=-0.152873
X2=-2.180460
13 Created
by
Krishna
Pal
Programming
lab(C)
.
5.
Write
a
programme
to
find
the
sum
of
natural
numbers
from
1
to
a
given
numbers.
.
####Definition : The act or process of adding, especially the process of computing
with sets of
numbers so as to find their sum.
.
####Flow Chart :
START
Input N
Sum = 0I=1
No
Yes
Is
I <= N
STOP
Print Sum
Sum = Sum +I
I = 1 + 1
14 Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
int n,sum=0,i; /* Declaration of variable */
clrscr(); /* Clear the console screen */
printf("\n\nEnter the limit\t:"); /* read limit of no. from user */
scanf("%d",&n);
for(i=1;i<=n;i++)
.
####Output :
Enter the limit :5
The sum of the natural numbers within given limit is :15
Enter the limit :0
The sum of the natural numbers within given limit is :0
Enter the limit :10
The sum of the natural numbers within given limit is :55
15 Created
by
Krishna
Pal
Programming
lab(C)
.
6.
Write
a
programme
to
find
the
factorial
of
a
number.
.
####Definition : The factorial of a positive integer N, denoted by N!, is the
product of all
positive integers equal to and less than N i.e. N!=1 * 2 * 3 *4 �N
.
####Flow Chart :
START
INPUT n
i = 1 is
i ++ i <= n
Fact = Fact * i
PRINT Fact
Fact = 1
STOP
16 Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
int n,fact=1,i; /* Declaration of variable */
clrscr() ; /* Clear the console screen */
printf("\n\nEnter the number\t:");
scanf("%d",&n);
for(i=1;i<=n;i++)
.
####Output :
Enter the number :0
The factorial of the given number is :1
Enter the number :1
The factorial of the given number is :1
Enter the number :5
The factorial of the given number is :120
17 Created
by
Krishna
Pal
Programming
lab(C)
.
7.
Write
a
programme
to
print
the
prime
numbers
from
1
to
a
given
numbers.
.
####Definition : An integer greater than 1 that is not evenly divisible by any
number other than
itself.
.
####Flow Chart :
START
Input N
18
No
Yes
Yes
No
Yes
#0
=0
#0
=0
Flag = 0
J = 2
Is
I <= N
STOP
Print I
I = 1
Is
J <= I/2
is
I % J
Flag = 1
J = J +1
is
Flag
I = I +1
Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
int n,i,j,flag; /* Declaration of variable */
clrscr(); /* Clear the console screen */
printf("\n\nEnter the limit\t:"); /* read limit of no. from user */
scanf("%d",&n);
printf("\nThe prime numbers within the given limit:\n");
for(i=1;i<=n;i++)
{ flag=0;
for(j=2;j<=i/2;j++)
if(flag==0)
printf("%d\t",i);
}
getch();
.
####Output :
Enter the limit :10
19 Created
by
Krishna
Pal
Programming
lab(C)
.
8.
Write
a
programme
to
print
the
perfect
numbers
from
1
to
a
given
numbers.
.
####Definition : A perfect number is a number equal to the sum of all its proper
divisors(divisors smaller than the number) including 1.
.
####Flow Chart :
START
Input N
20
No
Yes
Yes
No
Yes
#0
=0
No
Yes
S = 0
J = 1
Is
I <= N
STOP
Print I
I = 1
Is
J <= I/2
is
I % J
S = S + J
J = J +1
is
S = I
I = I +1
Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
int n,i,s,j; /* Declaration of variable */
clrscr(); /* Clear the console screen */
printf("\n\nEnter the limit\t:");
scanf("%d",&n); /* read limit of no. from user */
printf("\nThe Perfect numbers within the given limit:\n");
for(i=1;i<=n;i++)
{
s=0;
for(j=1;j<=i/2;j++)
{
}
getch();
.
####Output :
Enter the limit :10
21 Created
by
Krishna
Pal
Programming
lab(C)
.
9.
Write
a
programme
to
print
the
Fibonacci
series
:
1,1,2,3,5,8,13,..........N.
.
####Definition : Sequence of numbers in which 1 appears twice as the first two
numbers, and
every subsequent number is the sum of two preceding numbers i.e. Fn = Fn-1 + Fn-2
.
####Flow Chart :
No
Yes
START
INPUT T
is
I <= T
M = 0
N = 1
F = 1
F = M + N
M = N
N = F
STOP
PRINT F
I = 1
I = I + 1
22 Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
int t,i,m=0,n=1,f=1; /* Declaration & Initialization of variable */
clrscr(); /* Clear the console screen */
printf("\n\nEnter the number of terms\t:");
scanf("%d",&t); /* read no. of terms from user */
printf("\n The Fibonacci Series of %d terms:\n",t);
for(i=1;i<=t;i++)
{
printf("%d\t",f);
f=m+n; /* calculating Fibonacci number */
m=n;
n=f;
}
getch();
}
.
####Output :
Enter the number of terms :10
The Fibonacci Series of 10 terms:
1 1 2 3 5 8 13 21 34 55
Enter the number of terms :20
The Fibonacci Series of 20 terms:
1 1 2 3 5 8 13 21 34 55
89 144 233 377 610 987 1597 2584 4181 6765
23 Created
by
Krishna
Pal
Programming
lab(C)
.
10.
Write
a
programme
to
enter
some
numbers
and
find
how
many
of
them
are
odd/even
and
find
the
average
of
odd
and
even
numbers.
.
####Definition : An even number is an integer that is "evenly divisible" by 2, an
odd number is
an integer that is not evenly divisible by 2. Then count the odd and even number
separately.
And divide the sum of odd numbers by the number of odd number, Similar to even
numbers.
.
####Flow Chart :
Yes
#0 = 0
START
INPUT n
ev = 0, od = 0, sum_ev=0, sum_od=0,
avg_ev=0, avg_od=0
STOP
i =0 is
i ++ i < n
i =1 is
i ++ i <=n
INPUT a[i]
Is
a[i] % 2
sum_ev =sum_ev +a[i]
ev = ev + 1
sum_od =sum_od +a[i]
od = od + 1
PRINT ev, avg_ev, od, avg_od avg_ev = sum_ev / ev, avg_od = sum_od / od
No
24 Created
by
Krishna
Pal
Programming
lab(C)
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
{
int a[100],i,n,ev=0,od=0; /* Declaration & Initialization of variable */
float sum_ev=0,sum_od=0,avg_ev=0,avg_od=0;
clrscr(); /* Clear the console screen */
printf("\n\nEnter the number of terms[<100]\t:");
scanf("%d",&n); /* read no. of terms from user */
if(n>100) exit(0);
for(i=0;i<n;i++)
{
for(i=0;i<n;i++)
{
if(a[i]%2==0) /* checking for even/odd */
{ sum_ev+=a[i]; /* summing up even */
}
}
if(ev>0)
25 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
Enter the number of terms[<100] :10
26 Created
by
Krishna
Pal
Programming
lab(C)
.
11.
Enter
some
numbers
and
find
the
maximum
and
minimum
without
array.
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
clrscr();
scanf("%d",&n);
scanf("%d",&m);
max=min=m;
for(i=2;i<=n;i++)
scanf("%d",&m);
min=m;
if(m>max) /* Checking for maximum number */
max=m;
getch();
}
27 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
28 Created
by
Krishna
Pal
Programming
lab(C)
.
12.
Write
a
programme
to
find
the
L.C.M.
and
H.C.F
of
two
given
numbers.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
int m,n,r,i=1;
clrscr();
scanf("%d%d",&m,&n);
r=m;
while(r%n!=0)
getch();
}
.
####Output :
Enter two numbers: 2
9
29 Created
by
Krishna
Pal
Programming
lab(C)
.
13.
Write
a
programme
to
find
the
GCD
using
iteration
and
recursions
function.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
int m,n;
clrscr();
scanf("%d%d",&m,&n);
printf("\nThe GCD of [%d & %d] is= %d",m,n,gcd(m,n)); /* calling gcd function */
getch();
}
.
####Output :
Enter two numbers: 2
7
30 Created
by
Krishna
Pal
Programming
lab(C)
.
14.
Write
a
programme
to
accept
a
number
and
check
whether
it
is
Armstrong
or
not.
.
####Definition : An Armstrong number or a plus perfect number is a number that is
the sum of
its own digits each raised to the power of the number of digits.
.
####Programme :
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,d=0,temp,s=0;
clrscr();
printf("\n\nEnter a number:\t");
scanf("%d",&n);
temp=n;
while(temp)
{
d++;
}
temp=n;
while(temp) /* calculating Armstrong number */
{ s+=pow((temp%10),d);
temp/=10;
}
if (s==n)
printf("\nThe given number is an Armstrong Number.");
else
printf("\nThe given number isn't an Armstrong Number!");
getch();
}
.
####Output :
Enter a number: 153
The given number is an Armstrong Number.
Enter a number: 12
The given number isn't an Armstrong Number!
Enter a number: 7
31 Created
by
Krishna
Pal
Programming
lab(C)
.
15.
To
find
the
sum
of
the
digits
of
a
given
number.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
int n,s=0;
clrscr();
scanf("%d",&n);
while(n)
s+=(n%10);
n/=10;
getch();
}
.
####Output :
Enter the numbers: 100
The sum of the digits of the number is= 1
32 Created
by
Krishna
Pal
Programming
lab(C)
.
16.
To
print
the
palindrome
numbers
from
100
to
1000.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int n,s,i;
clrscr();
printf("\n\nThe Palindrome numbers from 100 to 1000 are:\n");
for(i=100;i<=1000;i++)
{
n=i;
s=0;
while(n)
{
s=s*10+(n%10);
n/=10;
}
if(s==i)
printf("%d\t",i);
}
getch();
.
####Output :
The Palindrome numbers from 100 to 1000 are:
101 111 121 131 141 151 161 171 181 191
202 212 222 232 242 252 262 272 282 292
303 313 323 333 343 353 363 373 383 393
404 414 424 434 444 454 464 474 484 494
505 515 525 535 545 555 565 575 585 595
606 616 626 636 646 656 666 676 686 696
707 717 727 737 747 757 767 777 787 797
808 818 828 838 848 858 868 878 888 898
909 919 929 939 949 959 969 979 989 999
33 Created
by
Krishna
Pal
Programming
lab(C)
.
17.
S=
1
+
X
+
X^3
+
X^5
+
.............N..
.
####Programme :
#include<stdio.h>
#include<conio.h>
#include<math.h>
/*Directives to include standard library for performing mathematical function pow()
*/
void main()
{
int X,n,i,s=1,k=1;
clrscr();
printf("\n\nEnter the value of X\t:");
scanf("%d",&X);
printf("\nEnter the number of terms\t:");
scanf("%d",&n);
for(i=2;i<=n;i++)
{ s+=pow(X,k);
k+=2;
}
printf("\nThe result is\t:%d",s);
getch();
.
####Output :
Enter the value of X :2
Enter the number of terms
The result is :1
:1
Enter the value of X :2
Enter the number of terms
The result is :171
:5
34 Created
by
Krishna
Pal
Programming
lab(C)
.
18.
S=
1+(1+2)+(1+2+3)+.........N.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
int n,i,s=0,r=0;
clrscr();
scanf("%d",&n);
for(i=1;i<=n;i++)
s+=i;
r+=s;
getch();
}
.
####Output :
Enter the number of terms :1
The result is :1
35 Created
by
Krishna
Pal
Programming
lab(C)
.
19.
S=
1+
2/2!
+
3/3!
+
4/4!
+......N.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
int n,i;
float s=0,f=1;
clrscr();
scanf("%d",&n);
for(i=1;i<=n;i++)
s+=(i/f);
getch();
}
.
####Output :
Enter the number of terms
The result is :1.000000
:1
Enter the number of terms
The result is :2.708333
:5
36 Created
by
Krishna
Pal
Programming
lab(C)
.
20.
S=
1
+
X
+
X^2
+
X^3/3!
+
X^4/4!
+.......N.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int x,n;
float s=1,f=1,p=1,i;
clrscr();
printf("\n\nEnter the number of terms\t:");
scanf("%d",&n);
printf("\nEnter the value of X\t:");
scanf("%d",&x);
for(i=1;i<n;i++)
{
f*=i;
p*=x;
s+=(p/f);
}
printf("\nThe result is\t:%f",s);
getch();
.
####Output :
Enter the number of terms
Enter the value of X :2
The result is :1.000000
:1
Enter the number of terms
Enter the value of X :2
The result is :7.000000
:5
37 Created
by
Krishna
Pal
Programming
lab(C)
.
21.
Sin
X=
X
-X^3/3!
+
X^5/5!
-X^7/7!
+..N.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int x,n,i,f=1,sign=1,p=1;
float s=0;
clrscr();
printf("\n\nEnter the number of terms\t:");
scanf("%d",&n);
printf("\nEnter the value of X\t:");
scanf("%d",&x);
for(i=1;i<n*2;i++)
{ f*=i;
p*=x;
if(i%2==0)
continue;
s+=sign*(float)p/f;
sign*=-1;
}
printf("\nThe result is\t:%f",s);
getch();
.
####Output :
Enter the number of terms
Enter the value of X :30
The result is :30.000000
:1
Enter the number of terms
Enter the value of X :2
The result is :0.891059
:5
38 Created
by
Krishna
Pal
Programming
lab(C)
.
22.
Enter
some
numbers
and
store
them
in
an
array,
then
enter
a
no
and
check
whether
it
exists
in
the
array
or
not.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int a[50],n,m,i,flag=0;
clrscr();
printf("\n\nHow many number do you have[<50]?\t");
scanf("%d",&n);
if(n>50)
if (flag==1)
printf("\nThe number has found in the array at %dth position.",i+1);
else
printf("\nEntered number does not exist in the array!");
getch();
}
39 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
40 Created
by
Krishna
Pal
Programming
lab(C)
.
23.
Enter
some
numbers
and
store
them
in
an
array,
now
create
two
array
of
odd
and
even
numbers.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int a[50],e[50],o[50],n,i,j=0,k=0;
clrscr();
printf("\n\nHow many numbers do you have[<50]?\t");
scanf("%d",&n);
if(n>50)
exit(0);
for(i=0;i<n;i++)
{
continue;
if(a[i]%2==0)
e[j++]=a[i]; /* inserting elements into array of even */
else
printf("%d\t",e[i]);
printf("\nOdd numbers are:\n");
for(i=0;i<k;i++)
printf("%d\t",o[i]);
getch();
}
41 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
How many numbers do you have[<50]?
Enter 1th number: 2
5
Enter 2th number: 0
Enter 3th number: 3
Enter 4th number: 7
Enter 5th number: 1
Even numbers are:
2
Odd numbers are:
3 7 1
How many numbers do you have[<50]?
Enter 1th number: 2
6
Enter 2th number: 2
Enter 3th number: 6
Enter 4th number: 9
Enter 5th number: 7
Enter 6th number: 10
Even numbers are:
2 2 6 10
Odd numbers are:
9 7
42 Created
by
Krishna
Pal
Programming
lab(C)
.
24.
Write
a
programme
to
change
a
Decimal
numbers
to
Binary
numbers.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int n,b[20],i=0,j;
clrscr();
printf("\n\nEnter Decimal number\t:");
scanf("%d",&n);
while(n)
{
b[i++]=n%2;
n/=2;
}
printf("\nEquivalent Binary number:\t");
for(j=i-1;j>=0;j--)
printf("%d",b[j]);
getch();
}
.
####Output :
Enter Decimal number :5
Equivalent Binary number: 101
Enter Decimal number :1
Equivalent Binary number: 1
Enter Decimal number :10
Equivalent Binary number: 1010
43 Created
by
Krishna
Pal
Programming
lab(C)
.
25.
Write
a
programme
to
change
decimal
numbers
to
Octal
and
Hexadecimals.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int n,oct[20],hex[20],i=0,j,k=0,temp;
clrscr();
printf("\n\nEnter Decimal number\t:");
scanf("%d",&n);
temp=n;
while(n)
{
oct[i++]=n%8;
/* storing equivalent Octal no. in reverse order */
n/=8;
}
n=temp;
while(n)
{
n/=16;
}
printf("\nEquivalent Octal number:\t");
for(j=i-1;j>=0;j--)
printf("%d",oct[j]);
/* printing equivalent Octal no. */
switch(hex[j])
{
case 10:printf("A"); break;
case 11:printf("B"); break;
case 12:printf("C"); break;
case 13:printf("D"); break;
case 14:printf("E"); break;
case 15:printf("F"); break;
default:printf("%d",hex[j]);
}
}
getch();
44
Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
45 Created
by
Krishna
Pal
Programming
lab(C)
.
26.
Write
a
programme
to
change
Binary
numbers
to
Decimals.
.
####Programme :
#include<stdio.h>
#include<conio.h>
#include<math.h> /*Directives to include standard library for performing
mathematical
function pow() */
void main()
{
int n,d=0,i=0,j;
clrscr();
printf("\n\nEnter Binary number\t:");
scanf("%d",&n);
while(n)
{
d+=(n%10)*pow(2,i++);
n/=10;
}
printf("\nEquivalent Decimal number:\t%d",d);
getch();
.
####Output :
Enter Binary number :101
Equivalent Decimal number: 5
46 Created
by
Krishna
Pal
Programming
lab(C)
.
27.
Write
a
programme
to
enter
elements
in
a
2D
Array
and
display
in
Matrix
from.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
clrscr();
scanf("%d",&r);
scanf("%d",&c);
for(j=0;j<c;j++)
scanf("%d",&a[i][j]);
clrscr();
for(i=0;i<r;i++)
{ for(j=0;j<c;j++)
printf("%d\t",a[i][j]);
printf("\n\n");
getch();
}
.
####Output :
Enter number of rows :3
1 2 12
4 5 50
7 0 10
47 Created
by
Krishna
Pal
Programming
lab(C)
.
28.
Write
a
programme
to
sort
some
numbers
using
bubble
sort
and
Selection
sort
separately.
.
####Programme :
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
int a[20],n;
clrscr();
scanf("%d",&n);
if(n>20)
getch(); exit(0);}
for(i=0;i<n;i++)
scanf("%d",&a[i]);
}
fflush(stdin);
switch(toupper(getchar()))
printf("\t%d",a[i]);
getch();
}
48 Created
by
Krishna
Pal
Programming
lab(C)
for(j=0;j<(n-1)-i;j++)
if(a[j]>a[j+1])
{ temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
for(i=0;i<n;i++)
{
min=a[i];
loc=i;
for(j=i+1;j<n;j++)
{ if(a[j]<min)
{
min=a[j];
loc=j;
}
}
if(loc!=i)
{ temp=a[i];
a[i]=a[loc];
a[loc]=temp;
}
}
}
.
####Output :
Enter the number of elements :5
Enter 1th number :1
Enter 2th number :2
Enter 3th number :-3
Enter 4th number :-4
Enter 5th number :0
49
Created
by
Krishna
Pal
Programming
lab(C)
50 Created
by
Krishna
Pal
Programming
lab(C)
.
29.
Write
a
programme
to
find
the
sum
of
each
row
in
a
2D
Array.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],i,j,r,c;
clrscr();
printf("\n\nEnter number of rows\t:");
scanf("%d",&r);
printf("\nEnter number of columns\t:");
scanf("%d",&c);
printf("\nEnter the elements[Row-Wise]:\n");
for(i=0;i<r;i++)
for(j=0;j<c;j++)
scanf("%d",&a[i][j]);
clrscr();
printf("\n\nThe given 2D Array is:\n");
for(i=0;i<r;i++)
{ for(j=0;j<c;j++)
printf("%4d",a[i][j]);
printf("\n\n");
}
/* Adding up each row elements and store them in last column of the 2D array*/
for(i=0;i<r;i++)
{ a[i][c]=0;
for(j=0;j<c;j++)
a[i][c]+=a[i][j];
}
/* printing the matrix after adding each row elements of the given 2D array */
printf("\n\nThe 2D Array after adding up each row:\n");
for(i=0;i<r;i++)
{ for(j=0;j<=c;j++)
if(j==c)
printf(" =%d",a[i][j]);
else
printf("%4d",a[i][j]);
printf("\n\n");
}
getch();
51 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
468 7
9 10 -2 -6
42 0 17 20
46 8 7 =25
9 10 -2 -6 =11
42 0 17 20 =79
52 Created
by
Krishna
Pal
Programming
lab(C)
.
30.
Write
a
programme
to
find
the
sum
of
each
column
of
a
2D
Array.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],i,j,r,c;
clrscr();
printf("\n\nEnter number of rows\t:");
scanf("%d",&r);
printf("\nEnter number of columns\t:");
scanf("%d",&c);
printf("\nEnter the elements[Row-Wise]:\n");
for(i=0;i<r;i++)
for(j=0;j<c;j++)
scanf("%d",&a[i][j]);
clrscr();
printf("\n\nThe given 2D Array is:\n");
for(i=0;i<r;i++)
{ for(j=0;j<c;j++)
printf("%4d",a[i][j]);
printf("\n\n");
}
/* Adding up each column elements and store them in last column of the 2D array*/
for(j=0;j<c;j++)
{ a[r][j]=0;
for(i=0;i<r;i++)
a[r][j]+=a[i][j];
}
/* printing the matrix after adding each column elements of the given 2D array */
printf("\n\nThe 2D array after adding up each column:\n");
for(i=0;i<=r;i++)
{ for(j=0;j<c;j++)
if(i==r)
printf(" =%d",a[i][j]);
else
printf("%4d",a[i][j]);
printf("\n\n");
}
getch();
53 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
Enter number of rows :3
1 0 2 3
5 4 6 9
7 8 4 3
10 2 3
54 6 9
78 4 3
54 Created
by
Krishna
Pal
Programming
lab(C)
.
31.
Write
a
programme
to
find
the
sum
of
the
diagonals
of
a
2D
Array.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],i,j,r,s=0;
clrscr();
printf("\n\nEnter number of rows[square matrix]\t:");
scanf("%d",&r);
printf("\nEnter the elements[Row-Wise]:\n");
for(i=0;i<r;i++)
for(j=0;j<r;j++)
scanf("%d",&a[i][j]);
clrscr();
printf("\n\nThe given 2D Array is:\n");
for(i=0;i<r;i++)
{ for(j=0;j<r;j++)
printf("%4d",a[i][j]);
printf("\n\n");
}
/* Adding up diagonals of the given 2D array */
for(j=0;j<r;j++)
{ for(i=0;i<r;i++)
{ if(i==j)
s+=a[i][j];
}
}
printf("\n\nThe sum of diagonals of the given 2D array:\t%d",s);
getch();
55 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
706
895
56 Created
by
Krishna
Pal
Programming
lab(C)
.
32.
Write
a
programme
to
find
the
sum
and
multiplication
of
two
matrices.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("\n\nEnter the number of rows of 1st Matrix:\t");
scanf("%d",&r1);
printf("\n\nEnter the number of columns of 1st Matrix:\t");
scanf("%d",&c1);
printf("\nEnter the elements of 1st Matrix[Row-wise]=\n");
for(i=0;i<r1;i++)
for(j=0;j<c1;j++)
scanf("%d",&a[i][j]);
printf("\n\nEnter the number of rows of 2nd Matrix:\t");
scanf("%d",&r2);
printf("\n\nEnter the number of columns of 2nd Matrix:\t");
scanf("%d",&c2);
printf("\nEnter the elements of 2nd Matrix[Row-wise]=\n");
for(i=0;i<r2;i++)
for(j=0;j<c2;j++)
scanf("%d",&b[i][j]);
clrscr();
printf("\n1st matrix is\n");
for(i=0;i<r1;i++)
{ for(j=0;j<c1;j++)
printf("%d\t",a[i][j]);
printf("\n"); }
printf("\n2nd matrix is\n");
for(i=0;i<r2;i++)
{ for(j=0;j<c2;j++)
printf("%d\t",b[i][j]);
printf("\n"); }
57 Created
by
Krishna
Pal
Programming
lab(C)
{
case 1: add(a,b); break; /* calling add() function */
case 2: multi(a,b); break; /* calling multi() function */
default: exit(0);
}
if(flag==0)
{ printf("\n\n The resultant matrix is given bellow:\n");
for(i=0;i<r1;i++)
{ for(j=0;j<c2;j++) /* printing result */
printf("%d\t",r[i][j]);
printf("\n");
}
}
printf("\n\nFor Addition=>1\nFor Multiplication=>2\nExit=>Other"
"\n\tEnter your choice:\t");
scanf("%d",&c);
}
getch();
{ for(i=0;i<r1;i++)
for(j=0;j<c1;j++)
r[i][j]=a[i][j]+b[i][j];
flag=0;
}
else
{ printf("\nAddition isn't possible!!");
getch();
flag=1;
}
}
{ for(i=0;i<r1;i++)
for(j=0;j<c2;j++)
{ r[i][j]=0;
for(k=0;k<c1;k++)
r[i][j]+=a[i][k]*b[k][j];
}
flag=0;
}
else
{ printf("\nMultiplication isn't possible!!");
getch();
flag=1;
}
}
58
Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
Enter the number of rows of 1st Matrix: 3
1st matrix is
123
049
647
2nd matrix is
156
304
512
59 Created
by
Krishna
Pal
Programming
lab(C)
For Addition=>1
For Multiplication=>2
Exit=>Other
2 7 9
3 4 13
11 5 9
For Addition=>1
For Multiplication=>2
Exit=>Other
For Addition=>1
For Multiplication=>2
Exit=>Other
1st matrix is
2
1
2nd matrix is
12
60 Created
by
Krishna
Pal
Programming
lab(C)
For Addition=>1
For Multiplication=>2
Exit=>Other
For Addition=>1
For Multiplication=>2
Exit=>Other
For Addition=>1
For Multiplication=>2
Exit=>Other
61 Created
by
Krishna
Pal
Programming
lab(C)
.
33.
Write
a
programme
to
find
the
transpose
of
a
matrix.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],i,j,r,c,s[10][10];
clrscr();
printf("\n\nEnter number of rows\t:");
scanf("%d",&r);
printf("\nEnter number of columns\t:");
scanf("%d",&c);
printf("\nEnter the elements[Row-Wise]:\n");
for(i=0;i<r;i++)
for(j=0;j<c;j++)
scanf("%d",&a[i][j]);
printf("\n\nThe given matrix is:\n");
for(i=0;i<r;i++)
{ for(j=0;j<c;j++)
printf("%4d",a[i][j]);
printf("\n\n");
}
printf("%4d",s[i][j]);
printf("\n\n");
}
getch();
62 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
9478
1014 0 6
2 414
370
586
63 Created
by
Krishna
Pal
Programming
lab(C)
.
34.
Write
a
programme
to
accept
a
sentence
and
find
the
number
of
words.
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
void main()
{
char s1[50];
clrscr();
printf("\nEnter your sentence:\t");
fflush(stdin);
gets(s1);
printf("\nNumber of words in your sentence is=%d",wordcounter(s1));
getch();
{
int c=1;
while(*s)
{ if(*s==' ')
c++;
s++;
}
return c;
}
.
####Output :
Enter your sentence: Rcc Institute of Information Technology!
Number of words in your sentence is=5
64
Created
by
Krishna
Pal
Programming
lab(C)
#35.Writeaprogrammetoacceptawordandcountthe
number
of
vowels.
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
char s1[50];
clrscr();
printf("\nEnter your word:\t");
scanf("%s",&s1);
printf("\nNumber of vowels in given word is=%d",vowelcounter(s1));
// Calling vowelcounter()
getch();
}
{
int c=0;
*s=tolower(*s);
while(*s)
{ if(*s=='a'||*s=='e'|| *s=='i'||*s=='o'||*s=='u')
c++;
s++;
}
return c;
.
####Output :
Enter your word: Institute
Number of vowels in given word is=4
65
Created
by
Krishna
Pal
Programming
lab(C)
#36.Writeaprogrammetoacceptasentenceandfindnumber
of
vowels,
consonants,
numbers,
spaces
and
special
characters.
.
####Programme :
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{ char s1[50],*s;
int v,c,n,sp,spcl;
v=c=n=sp=spcl=0;
clrscr();
fflush(stdin);
gets(s1);
s=s1;
*s=tolower(*s);
while(*s)
sp++;
n++;
v++;
else
else
s++;
.
####Output :
Enter your sentence: Rcc Institute of Information Technology!
66 Created
by
Krishna
Pal
Programming
lab(C)
#37.Writeaprogrammetoacceptawordandfindthesumof
its
ASCII
values.
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
void main()
{ char s1[50];
clrscr();
scanf("%s",&s1);
getch();
}
{ int sum=0;
while(*s)
{ sum+=*s;
s++;
return sum;
}
.
####Output :
Enter your word: MCA
Sum of ASCII value for the given word is=209
#38.Writeaprogrammetoacceptawordandprintitinreverse
forms.
.
####Programme :
/*Directives to include standard library and standard input-output header files in
this
program*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
clrscr();
printf("\nEnter a word:\t");
fflush(stdin);
gets(s1);
strev(s1); // calling strev ()
printf("\nReverse of the given word is:\t%s",s1);
getch();
{ char *t;
int i,j=0;
for(i=strlen(s)-1;i>=0;i--)
t[j++]=s[i];
t[j]='\0';
strcpy(s,t);
.
####Output :
Enter a word: Education
Reverse of the given word is: noitacudE
68 Created
by
Krishna
Pal
Programming
lab(C)
#39.Writeaprogrammetoacceptawordandcheckwhetherit
is
Palindrome
or
not.
.
####Programme :
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{ char s[20];
int i=0,j;
clrscr();
printf("\nEnter a word:\t");
fflush(stdin);
gets(s);
j=strlen(s)-1;
while(i<=j)
if(s[i++]!=s[j--])
break;
if(--i==++j)
printf("\nThe given word is Palindrome.");
else
printf("\nThe given word isn't Palindrome!");
getch();
}
.
####Output :
Enter a word: Malayalam
The given word is Palindrome.
69 Created
by
Krishna
Pal
Programming
lab(C)
#40.Writeaprogrammetoacceptasentenceandfindthe
occurrence
of
each
character..
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
char s1[50];
int i,j,k=1,m,flag;
clrscr();
printf("\nEnter your sentence:\t");
fflush(stdin);
gets(s1);
printf("\nThe occurrence of\n");
for(i=0;s1[i]!='\0';i++)
{ m=i-1;
flag=0;
while(m>=0)
if(s1[i]==s1[m--]) // is the character was previously checked?
{ flag=1;
break;
}
k=1;
for(j=i+1;s1[j]!='\0';j++) // counting the occurrences
if(s1[i]==s1[j])
k++;
if(flag==0)
printf("\t%c is:\t%d\n",s1[i],k);
}
getch();
}
.
####Output :
Enter your sentence: I Love My India!
The occurrence of
I is: 2
is: 3
L is: 1
o is: 1
v is: 1
e is: 1
M is: 1
y is: 1
n is: 1
d is: 1
i is: 1
a is: 1
! is: 1
70
Created
by
Krishna
Pal
Programming
lab(C)
#41.Writeaprogrammetoacceptanameofpersonandprint
the
1st
letter
of
the
first
and
middles
(if
any)
and
the
title
as
it
is
in
examples:
Raja
Ram
Das
.
R.
R.
Das
or
Rahul
Ray
.
R.
Ray.
.
####Programme :
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char name[50],title[20],temp[30];
int i=0,j,k=0,m;
clrscr();
printf("\n\nEnter your full name\t:");
fflush(stdin);
gets(name);
j=strlen(name)-1;
temp[0]=name[0];
for(i=j;i>=0;i--)
{ if(name[i]==' ')
break;
if(name[i]==' ')
{ temp[++j]='.';
temp[++j]=' ';
temp[++j]=name[++i]; // taking the first letter of each word
}
for(i=k-1;i>=0;i--)
.
####Output :
Enter your full name :Hare Krishna Pal.
Your short name is :H. K. Pal.
71
Created
by
Krishna
Pal
Programming
lab(C)
#42.Writeaprogrammetoacceptastringasacommandlone
argument
and
then
find
its
length.
.
####Programme :
#include<stdio.h>
int n=0;
char *p=argv[1];
if(argc==2)
{ while(*p)
p++;
}
}
.
####Output :
Type EXIT to return to Turbo C++. . .Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.
C:\TC>lengthof Krishna
The length of the given string is: 7
C:\TC>lengthof Rcciit
The length of the given string is: 6
C:\TC>
72 Created
by
Krishna
Pal
Programming
lab(C)
#43.Writeaprogrammetoaccepttextfromkeyboardand
store
them
in
a
file
and
then
display
the
content
of
the
saved
file.
.
####Programme :
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp; // declaration of file pointer
char c;
clrscr();
fp=fopen("fileinC.txt","w"); // opening a new file in write mode
if(fp==NULL) // checking for file opening error
{ printf("\n\nFile opening error!");
getch();
exit(0);
}
printf("\nEnter the text for file?\n[Press Ctrl+Z to terminate]\n");
while((c=getchar())!= EOF) //read character from keyboard
printf("%c",c);
fclose(fp); //finally closing the file
getch();
.
####Output :
Enter the text for file?
[Press Ctrl+Z to terminate]
Name of College: Rcc Institute of Information Technology!
^Z
Name of College: Rcc Institute of Information Technology!
73 Created
by
Krishna
Pal
Programming
lab(C)
#44.Writeaprogrammetoaccept10students�namesand
marks
of
three
subjects
then
calculate
the
total
marks
and
store
them
in
a
file.
.
####Programme :
#include<stdio.h>
#include<conio.h>
{
char name[30];
int sub1,sub2,sub3,total;
};
void main()
{
struct student p,st[10],*s; // Declarations of array of structure, pointer to
structure
char c;
int i;
long n;
FILE *fp=fopen("fileinC.txt","w"); //opening a new file named fileinC.txt
if(fp==NULL) //checking for file opening error
{ printf("\n\nFile opening error!");
getch();
exit(0);
}
clrscr();
s=st;
fflush(stdin);
gets(s->name);
printf("\nEnter Marks of three subjects?");
scanf("%d%d%d",&s->sub1,&s->sub2,&s->sub3);
s->total = s->sub1+s->sub2+s->sub3;
fprintf(fp," %s %d %d %d %d",s->name,s->sub1,s->sub2,s->sub3,s->total);
s++;
}
n=ftell(fp); // store the position of last character in file to n
fclose(fp); //close the file
clrscr();
fp=fopen("fileinC.txt","r"); //reopen the file in read mode
printf("\n\nRecords on the saved file are:\n\n");
printf("Names\t\tSub1\tSub2\tSub3\tTotal\n");
printf("-----\t\t----\t----\t----\t-----\n");
while(ftell(fp)<n)
{ fscanf(fp,"%s %d %d %d %d",p.name,&p.sub1,&p.sub2,&p.sub3,&p.total);
printf("%-15s%5d%8d%8d%8d\n",p.name,p.sub1,p.sub2,p.sub3,p.total);
}
fclose(fp); //finally closing the file
getch();
74 Created
by
Krishna
Pal
Programming
lab(C)
.
####Output :
Enter Name of 1th student[Single word]?Krishna
75 Created
by
Krishna
Pal
Programming
lab(C)
TheEndTheEndTheEndTheEnd
R
RRRRe
eeeem
mmmma
aaaar
rrrrk
kkkks
ssss:
::::----
S
SSSSi
iiiig
ggggn
nnnna
aaaat
ttttu
uuuur
rrrre
eeee:
::::
D
DDDDa
aaaat
tttte
eeees
ssss:
::::
76 Created
by
Krishna
Pal