Академический Документы
Профессиональный Документы
Культура Документы
start
PROGRAM
/* Program to find the biggest of the given three numbers */
#include<stdio.h>
/* printf(), scanf() */
#include<conio.h>
/* getch(), clrscr() */
void main()
{
int x,y,z,max;
clrscr();
printf("Enter x value:");
scanf("%d",&x);
printf("Enter y value:");
scanf("%d",&y);
printf("Enter z value:");
scanf("%d",&z);
if(x<y)
{
if(y<z)
max=z;
else
max=y;
}
else
{
if(x<z)
max=z;
else
max=x;
}
printf("Biggest Of The Given Three Numbers is %d ",max);
getch();
the screen */
}
PROGRAM
/* Program to print Electricity bill with slabs */
#include<stdio.h>
/* printf(), scanf() */
#include<conio.h>
/* getch(), clrscr() */
void main()
{
int n,cr,pr,mno;
char utype;
float bill=0.0;
clrscr();
printf("\n\t****************************************");
printf("\n\t*****ELECTRICITY
BILL
CALCULATION*******");
printf("\n\t****************************************");
printf("\nEnter meter number :");
scanf("%d",&mno);
/*Reading current and previous readings*/
printf("\nEnter current reading:");
scanf("%d",&cr);
printf("\nEnter previous reading:");
scanf("%d",&pr);
/*Computing number of units consumed*/
n=cr-pr;
if(n>=0&&n<=200)
bill=n*0.50;
else if(n>200&&n<=400)
bill=100+n*0.65;
else if(n>400&&n<=600)
bill=230+n*0.80;
else if(n>600)
bill=390+n*1.0;
else
printf("\nInvalid number of units");
if(bill>0)
{
printf("\nThe meter number= %d",mno);
printf("\nThe number of units consumed=%d",n);
printf("\nBill amount for %d units is %f\n",n,bill);
}
getch();
the screen */
}
PROGRAM
/* Program to print Student grades */
#include<stdio.h>
/* printf(), scanf() */
#include<conio.h>
/* getch(), clrscr() */
void main()
{
int n1,n2,n3,tot;
printf("Enter your mark\n ");
printf("Subject 1:");
scanf("%d",&n1);
printf("Subject 2:");
scanf("%d",&n2);
printf("Subject 3:");
scanf("%d",&n3);
if(n1<0 || n2<0 || n3<0)
{
printf("\n Invalid Marks");
exit(0);
}
if(n1<35 || n2<35 || n3<35)
{
printf("\n You Failed in this exam");
exit(0);
}
tot=n1+n2+n3;
printf("\n Total Marks %d", tot);
// printing outputs
// printing outputs
else & if
printf("\n You got B grade");}
else if ( tot >=40){
printf("\nYou got C grade");}
else if ( tot < 40){
printf("\n You Failed in this exam");}
getch();
}
2. CONTROL STATEMENTS
1) WRITE
C-PROGRAM
TO
IMPLEMENT
THE
read a, b values
Write a+b
read a, b values
Write a*b
read a, b values
Write a%b
Step 10: default:
Invalid operation"
PROGRAM
/*Program to implement the calculator application (using
switch)*/
#include<stdio.h>
#include<conio.h>
/* printf(), scanf() */
/* getch(), clrscr() */
void main()
{
int a,b;
char sign;
clrscr();
printf("\nPlease enter an operation +, -, *, /, %, <'Q' to quit>: ");
flush(stdin);
scanf("%c",&sign);
while (sign != 'Q' && sign != 'q')
{
switch(sign)
{
case '+': printf("\nEnter 2 numbers : ");
scanf("%d%d",&a,&b);
printf("Addition
of
%d
and
%d
is
%d
is
%d
is
%d\n",a,b,a+b);
break;
case '-':
of
%d
and
%d\n",a,b,a-b);
break;
case '*':
of
%d
and
%d\n",a,b,a*b);
break;
case '/':
of
%d
and
%d
%d\n",a,b,a%b);
break;
default:
printf("\nInvalid Option\n");
is
break;
}
printf("\nPlease enter an operation +, -, *, /, %, <'Q' to
quit>: ");
fflush(stdin);
scanf("%c",&sign);
}
getch();
}
PROGRAM
/* Program to print table for a given number*/
#include<stdio.h>
/* printf(), scanf() */
#include<conio.h>
/* getch(), clrscr() */
void main()
{
int i,n;
clrscr();
printf("\nEnter Number to Generate Table: ");
scanf("%d",&n);
printf("\n %d Table ",n);
printf("\n----------------------");
for(i=1;i<10;i++)
{
printf("\n%d X %d = %d",n,i,n*i);
}
getch();
}
PROGRAM
/* Program to print 1 to n natural numbers */
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("\nEnter Number to Print 1 to N natural Numbers: ");
scanf("%d",&n);
printf("\n1 to %d Natural Numbers ",n);
printf("\n----------------------------------\n");
for(i=1;i<n;i++)
{
printf("%d\t",i);
}
getch();
}
LOOPING CONSTRUCTS-I
1) WRITE A C-PROGRAM TO CHECK THE GIVEN NUMBER
IS ARMSTRONG OR NOT
ALGORITHM
Step 1: start
Step 2: Declare variables n, r, temp ,count=0 as Integer data
types
Step 3: Read n value Assign temp = n
Step 4: Assign temp = n
Step 5: Compute
r=n%10
count=count+(r*r*r)
n=n/10
Step 6: Repeat Step 5 while n>0
Step 7: if count equals to temp then
Write Given number is Armstrong
Else
Write Given number is Not Armstrong
Step 8: Stop
PROGRAM
/* Program to Check the Given Number Is Armstrong Or Not*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,count=0,r,temp;
clrscr();
printf("Enter a number : ");
scanf("%d",&n);
temp=n;
while(n>0)
{
r=n%10;
count=count+(r*r*r);
n=n/10;
}
if(count==temp)
printf("\nGiven Number is Armstrong");
else
printf("\nGiven Number is not Armstrong");
getch();
}
PROGRAM
/*Program to check the given number is palindrome or not*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,count=0,r,temp,opt;
clrscr();
printf("Enter a number : ");
scanf("%d",&n)
temp=n;
while(n>0)
{
r=n%10;
count=(count*10)+r;
n=n/10;
}
if(count==temp)
printf("\nGiven Number is Palindrome");
else
printf("\nGiven Number is not Palindrome");
getch();
}
PROGRAM
/*Program to check the given number is perfect or not*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,count=0,r,temp,opt;
clrscr();
printf("Enter a number : ")
scanf("%d",&n);
for(i=1;i<=n/2;i++)
{
if(n%i==0)
count=count+i;
}
if(n==count)
printf("Given number is Perfect number");
else
printf("Given number is not Perfect number");
getch();
}
{
int n,i,f,r,count=0,temp;
printf("Enter a number: ");
scanf("%d",&n);
while(n>0)
{
i=1;f=1;
r=n%10;
while(i<=r){
f=f*i;
i++;
}
count=count+f;
n=n/10;
}
if(count==temp)
printf("%d is a strong number",temp);
else
printf("%d is not a strong number",temp);
getch();
}
PROGRAM
/* Program to print the reverse of the given number */
#include<stdio.h>
#include<conio.h>
void main()
{
int n,count=0,r,temp,opt;
clrscr();
printf("Enter a number : ");
scanf("%d",&n);
temp=n
while(n>0)
{
r=n%10;
count=(count*10)+r;
n=n/10;
}
printf("\nReverse of %d is %d",temp,count);
getch();
}
PROGRAM
/* Program to convert the given decimal number to binary
number */
#include<stdio.h>
#include<conio.h>
void main()
{
long int n,num=0,bin=0,cnt=0,m;
int r;
clrscr();
printf("\nEnter a number:");
scanf("%ld",&n);
m=n;
for(;n>0;n=n/2)
{
r=n%2;
num=(num*10)+r
cnt++;
}
for(n=num;cnt>0;n=n/10)
{
r=n%10;
bin=(bin*10)+r;
cnt--;
}
printf("\nThe binary number of given decimal number %ld
is %ld",m,bin);
getch();
}
LOOPING CONSTRUCTS-II
1) WRITE A C-PROGRAM TO PRINT SUM OF N NATURAL
NUMBERS
ALGORITHM
Step 1: start
Step 2: read n
Step 3: set i:=1,sum=0
Step 4: repeat steps 5,6,7 until in
Step 5: read num
Step 6: set sum:=sum+num
Step 7: set i:=i+1
Step 8: write sum
Step 9: stop
PROGRAM
/* Program to print sum of n natural numbers */
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,sum=0,num;
clrscr();
printf("\nEnter value for n:");
scanf("%d",&n);
i=1;
do
{
printf("\nEnter a number:");
scanf("%d",&num);
sum=sum+num;
i=i+1;
}while(i<=n);
printf("\n The sum of %d numbers=%d",n,sum);
getch();
}
clrscr();
printf("\nEnter value for n:");
scanf("%d",&n);
printf("\nThe Prime Numbers from 1 to %d\n\n",n);
for(i=1;i<=n;i++)
{
cnt=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
cnt++;
}
if(cnt==2)
printf("%d\t",i);
}
getch();
}
PROGRAM
/* Program to find the sum of first N Natural Numbers */
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,sum=0;
clrscr();
printf("\nEnter N value : ");
scanf("%d", &n);
i=1;
do
{
sum = sum + i
i = i++;
}
while(i<=n);
printf("\nSum of first %d Natural Numbers : %d",n,sum);
getch();
}
3. ARRAYS
1) WRITE
C-PROGRAM
TO
REMOVE
DUPLICATE
PROGRAM
/* program to remove duplicate elements in the given array */
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,n,a[20],temp;
clrscr();
printf("\nEnter the Size of Array:");
scanf("%d",n);
printf("\nEnter the Elements of array:");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("\nElements Before Removing Duplicate Elements :");
for(i=0;i<n;i++)
printf("%3d",a[i]);
for(i=0;i<n;i++)
{
for(j=i+1;j<n;)
{
if(a[i]==a[j])
{
for(k=j;k<n;k++)
a[k]=a[k+1];
n=n-1;
}
else
j++;
}
}
printf("\n\nRemaining Elements are:");
for(i=0;i<n;i++)
printf("%3d",a[i]);
getch();
}
which
Position
want
to
Element:");
scanf("%d",&pos);
insert
PROGRAM
/*Program to arrange the given elements in the ascending order
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,a[20],temp;
clrscr();
printf("\nEnter the Size of Array:");
scanf("%d",&n);
printf("\nEnter the Elements of array:");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("\nElements Before Sorting :");
for(i=0;i<n;i++)
printf("%3d",a[i]);
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
printf("\n\nAfter Sorting Elements are:");
for(i=0;i<n;i++)
printf("%3d",a[i]);
getch();
}
STRINGS
1) WRITE A C-PROGRAM TO PERFORM THE FOLLOWING
OPERATIONS WITH AND WITHOUT USING STRING
HANDLING FUNCTIONS
I.
(b)
(c)Write j
Else
Break;
Step 7: stop
PROGRAM
/* Program to find length of the string */
#include<stdio.h>
#include<conio.h>
void main()
{
char a[10];
int j=0,l=0,i=0,opt;
clrscr();
printf("\n Enter String:");
scanf("%s",a)
while(1)
{
printf("\n\n1.Using String Handling
Function\n2.Without using String Handling
Functions\n3.exit\nEnter your Option:");
scanf("%d",&opt);
if(opt==1)
{
l=strlen(a);
printf("\n length of the string using Strlen()
:%d",l);
}
else if(opt==2)
{
while(a[i]!='\0')
{
j++;
i++;
}
printf("\n Length of the given string is %d",l);
}
else
break;
}
getch();
}
i=strlen(a)
i=i+1
Else
Break;
Step 8: stop
PROGRAM
/* Program to reverse the string */
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[10],b[10];
int l=0,i=0,opt;
clrscr();
printf("\n Enter String:");
scanf("%S",a);
strcpy(b,a);
while(1)
{
printf("\n\n1.Using String Handling
Function\n2.Without using String Handling
Functions\n3.exit\nEnter your Option:");
scanf("%d",&opt);
if(opt==1)
{
printf("\n Reverse of the string using Strrev()
:%s",strrev(b));
}
else if(opt==2)
{
l=strlen(a);
printf("\n Reverse of the given string :");
for(i=l;i>=0;i--)
{
printf("%c",a[i]);
}
}
else
break;
}
getch();
}
l=strlen(a)
c[l+i]=\0
Else
Break;
Step 7: stop
PROGRAM
/* Program to concatenate two strings */
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[10],b[10],c[10];
int l=0,i=0,opt;
clrscr();
printf("\n Enter String1:");
scanf("%s",a);
printf("\n Enter String2:")
scanf("%s",b);
while(1)
{
printf("\n\n1.Using String Handling
Function\n2.Without using String Handling
Functions\n3.exit\nEnter your Option:");
scanf("%d",&opt);
if(opt==1)
{
strcpy(c,a);
strcat(c,b);
printf("\n\n Concatenated String:%s",c);
}
else if(opt==2)
{
l=strlen(a);
strcpy(c,a);
for(i=0;b[i]!='\0';i++)
{
c[i+l]=b[i];
}
c[i+l]='\0';
printf("\n\n Concatenated String: %s",c);
}
else
break;
}
getch();
}
Step 7: stop
PROGRAM
/* Program to Compare to Strings */
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[10],b[10];
int i=0,opt;
clrscr();
printf("\n Enter String1:")
scanf("%s",a);
printf("\n Enter String2:");
scanf("%s",b);
while(1)
{
printf("\n\n1.Using String Handling Function\n2.Without using
String Handling Functions\n3.exit\nEnter your Option:");
scanf("%d",&opt);
if(opt==1)
{
if( strcmp(a,b) == 0 )
*b = *a;
*a = temp;
step 3: write *a,*b
step 4: stop
PROGRAM
/* Program to swap the two numbers using call by value and call
by reference */
#include<stdio.h>
#include<conio.h>
void swapreference(int*, int*);
void swapvalue(int,int);
void main()
{
int x, y;
printf("Enter the value of x and y\n")
scanf("%d%d",&x,&y);
printf("\n----Swap using Call By Value----");
printf("\n\nBefore Swapping\nx = %d\ny = %d\n", x, y);
swapvalue(x, y);
printf("\nAfter Swapping\nx = %d\ny = %d\n", x, y);
printf("\n----Swap using Call By Reference----");
printf("\n\nBefore Swapping\nx = %d\ny = %d\n", x, y);
swapreference(&x, &y);
parameters
{
int t ;
t=a;
a=b;
b=t;
printf("\nInside called Function\n");
printf ( "a = %d\nb = %d\n", a, b) ;
}
PROGRAM
/* Program to find the factorial of the given number using
recursion */
#include<stdio.h>
#include<conio.h>
void main()
{
int n,ft;
int fact(int);
clrscr();
printf("\nEnter the value of n:");
scanf("%d",&n);
ft=fact(n);
printf(\n\n\tFactorial of %d = %d\n",n,ft);
getch();
}
int fact(int a)
{
if(a==1)
return 1;
else
return a*fact(a-1);
PROGRAM
{
if(n==1)
return 1;
else
return n*fact(n-1);
}
PROGRAM
/* Program to find mean and standard deviation of a given set of
numbers */
#include<stdio.h>
#include <math.h>
#include<conio.h>
#define MAXSIZE 10
float mean(float x[10],int n);
void sd(float m,float x[10],int n);
void main()
{
float x[MAXSIZE],m;
int i, n;
clrscr();
float sum=0
for (i=0;i<n;i++)
sum=sum+x[i];
sum=sum/(float)n;
printf("MEAN IS %5.2f\n",sum);
return sum;
}
void sd(float m,float x[10],int n)
{
float average, variance, std_deviation,sum=0;
/* Compute variance and standard deviation */
int i=0;
for (i = 0; i < n; i++)
{
sum = sum + pow((x[i] - m), 2);
}
variance = sum/ (float)n;
std_deviation = sqrt(variance);
//printf("variance of all elements = %.2f\n", variance);
printf("Standard deviation = %.2f\n", std_deviation);
}
C-PROGRAM
TO
COUNT
NUMBER
OF
ch=fgetc(fr)
Step 10: close file
fclose(fr);
Step 11: write now,noc,nol
Step 12: Stop
PROGRAM
/* Program to count number of characters, spaces, words and
lines in given file */
#include<stdio.h>
#include<conio.h>
void main()
{
int noc=0,now=0,nol=0;
FILE *fw,*fr;
char fname[20],ch;
clrscr();
printf("\n Enter the source file name:");
gets(fname);
fr=fopen(fname,"r");
if(fr==NULL)
{
printf("\n error \n");
exit(0);
}
ch=fgetc(fr);
while(ch!=EOF)
{
noc+;
if(ch==' ');
now++;
if(ch=='\n')
{
nol++;
now++;
}
ch=fgetc(fr);
}
fclose(fr);
printf("\n total no of character=%d",noc);
printf("\n total no of words=%d",now);
printf("\n total no of lines=%d",nol);
getch();
}
PROGRAM
/* Program to copy the content of one file into another file using
command line arguments */
#include<stdio.h>
#include<conio.h>
int main(int argc,char *argv[])
{
FILE fs,*ft;
int ch;
if(argc!=3)
{
printf("Invalide numbers of arguments.");
return 1;
}
fs=fopen(argv[1],"r");
if(fs==NULL)
{
printf("Can't find the source file.");
return 1;
}
ft=fopen(argv[2],"w");
if(ft==NULL)
{
printf("Can't open target file.");
fclose(fs);
return 1;
}
while(1)
{
ch=fgetc(fs);
if (feof(fs)) break;
fputc(ch,ft);
}
fclose(fs);
fclose(ft);
return 0;
}
POINTERS
1) WRITE A C-PROGRAM TO IMPLEMENT ARITHMETIC
OPERATIONS USING POINTERS
ALGORITHM
Step 1: start
Step 2: declare: n1, n2 as integer data type and *x,*y as integer
type pointers
Step 3: read 2 numbers: n1, n2
Step 4: Set x=&n1 and y=&n2
Write *x+*y
Write *x-*y
Write *x x *y
Write *x/*y
Write *x%*y
Step 5: stop
PROGRAM
/* Program to implement arithmetic operations using pointers */
#include <stdio.h>
#include <conio.h>
/* clrscr(), getch() */
void main()
{
int n1,n2,*x,*y;
clrscr();
/* 2 integer variables */
/* clears the screen */
strcpy(x[i],t)
Step 6: stop
PROGRAM
/* Program to sort names in ascending order using functions */
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char *x[20];
int i,n=0;
void reorder(int n,char *x[]);
clrscr();
printf("Enter no. of String : ")
scanf("%f",&n);
printf("\n");
for(i=0;i<n;i++)
{
printf("Enter the Strings %d : ",i+1);
/* allocating memory to array element */
x[i]=(char *)malloc(20*sizeof(char));
scanf("%s",x[i]);
}
reorder(n,x);
printf("\nreorder list is : \n");
for(i=0;i<n;i++)
{
printf("%d %s\n",i+1,x[i]);
}
getch();
}
void reorder(int n,char *x[])
{
int i,j;
char t[20];
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(strcmp(x[i],x[j])>0)
{
strcpy(t,x[j]);
strcpy(x[j],x[i]);
strcpy(x[i],t);
}
return;
}
{
struct Student s;
clrscr();
printf("\nEnter Student number : ");
scanf("%d",&s.sno);
printf("\nEnter Student name
: ");
fflush(stdin);
gets(s.name);
printf(\nEnter gender
: ");
scanf("%c",&s.gen);
printf("\nEnter Marks
: ");
scanf("%f",&s.marks);
clrscr()
printf("\t\t\t STUDENT DETAILS \n\n");
printf("\nStudent Number
printf("\nStudnet Name
: %d",s.sno);
: %s",s.name);
printf("\nGender
: %c",s.gen);
printf("\nMarks
: %.2f",s.marks);
getch();
}
Write Monday
Write Tuesday
Write Wednesday
Write Thursday
Write Friday
Write Saturday
Write Sunday
Step 9: default:
Invalid operation"
printf("Today is a Monday.\n");
break;
case Tuesday
printf("Today is a Tuesday.\n");
break;
case Wednesday:
printf("Today is a Wednesday.\n");
break;
case Thursday:
printf("Today is a Thursday.\n");
break;
case Friday:
printf("Today is a Friday.\n");
break;
case Saturday:
printf("Today is a Saturday.\n");
break;
case Sunday:
printf("Today is a Sunday.\n");
break;
default:
printf("Invalid Option\n");
}
2. STRUCTURES
1) WRITE A C-PROGRAM TO READ NAME OF THE
STUDENT, ROLLNUMBER AND MARKS OBTAINED IN
SUBJECTS FROM KEYBOARD AND PRINT NAME OF
STUDENT, ROLLNUMBER, MARKS IN 3 SUBJECTS AND
TOTAL MARKS BY USING STRUCTURES CONCEPT
ALGORITHM
Step 1: start
Step 2: declare Structure
Step 3: read sno, name, marks using structure variable s
Step 4: calculate total =s.m1+s.m2+s.m3
Step 5: write sno, name, marks and total
Step 6: stop
PROGRAM
/* Program to read name of the student, rollnumber and marks
obtained in subjects from keyboard and print name of student,
rollnumber, marks in 3 subjects and total marks by using
structures concept */
#include<stdio.h>
#include <conio.h>
#include <string.h>
struct Student
{
int sno;
char name[20];
float m1,m2,m3;
};
void main()
{
struct Student s;
clrscr();
printf("\nEnter Student number : ");
scanf("%d",&s.sno);
printf("\nEnter Student name
: ");
fflush(stdin);
gets(s.name);
printf("\nEnter Marks in Subject 1: ");
scanf("%f",&s.m1);
printf("\nEnter Marks in Subject 2: ");
scanf("%f",&s.m2);
printf("\nEnter Marks in Subject 3: ");
scanf("%f",&s.m3);
clrscr();
printf("\t\t\t STUDENT DETAILS \n\n");
printf("\nStudent Number
: %d",s.sno);
printf("\nStudnet Name
: %s",s.name);
printf("\nMarks in Subject1
: %.2f",s.m1);
printf("\nMarks in Subject2
: %.2f",s.m2);
printf("\nMarks in Subject3
: %.2f",s.m3);
printf("\nTotal Marks
: %.2f",s.m1+s.m2+s.m3);
getch();
}
PROGRAM
/* Program to read name of the student, rollnumber and marks
obtained in subjects from keyboard and print name of student,
rollnumber, marks in 3 subjects and total marks by using arrays
of structures concept */
#include<stdio.h>
#include <conio.h>
#include <string.h>
struct Student
{
int sno;
char name[20];
float m1,m2,m3;
};
void main()
{
struct Student s[10];
int n,i;
clrscr();
printf("Enter Number of Students:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
: ");
fflush(stdin);
gets(s[i].name);
printf("\nEnter Marks in Subject 1: ");
scanf("%f",&s[i].m1);
printf("\nEnter Marks in Subject 2: ");
scanf("%f",&s[i].m2);
printf("\nEnter Marks in Subject 3: ");
scanf("%f",&s[i].m3);
}
clrscr();
for(i=0;i<n;i++)
{
printf("\n\n STUDENT %d \n",i+1);
printf("\nStudent Number
printf("\nStudnet Name
: %d",s[i].sno);
: %s",s[i].name);
printf("\nMarks in Subject1
: %.2f",s[i].m1);
printf("\nMarks in Subject2
: %.2f",s[i].m2);
printf("\nMarks in Subject3
: %.2f",s[i].m3);
printf("\nTotal Marks
%.2f",s[i].m1+s[i].m2+s[i].m3);
}
getch();
}