0% found this document useful (0 votes)
15 views6 pages

COMPUTER September 08

Uploaded by

milanroy34
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

COMPUTER September 08

Uploaded by

milanroy34
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

RunO Debug StopGShare Save0 Beautify

f o r a i n . c

/****** F*************t**t******tt****ttt***************5

Online C Compiler.
Code, Compile, Run and Debug C program or
Write your code in this edi tor and press "Run" button to

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

8 1/Milan Roy
9 1/Ro1l no.39
10 #include<stdio.h>
11 #include<string.h>
12 #define MAX 2
13 struct employee
14
5 char name[20];
int empid;
float salary;
18
19 int main()
20
21 struct employee e[MAX1:
int i;
for (i-0; i<MAX; i++)
24
25 printf("\nEnter details of employee %dn\n", i+1)
20
printfC"Enter employee name:);
27 Scanf("%s", e[i].name);
28 printtEnter employee 1d: ");
29 scanf(%d", &e[i].empid)D;
30 printf("Enter salary: ")
31 scanf("%f", &e[i].salary);
32
33
input

Enter details of employee 1

Enter employee name: Alen

Enter employee id: 97574


Enter salary : 784959

Enter details of employee 2

Enter employee name: maial


employee id: 9485577
Enter
Enter salary : 844858

..Program finished with exit code o


Press ENTER to exit console
|
dalb

9TEP I 1ART

re nAyrà, i
3kp 4
EP
97 3: l i > Mn), go
.1
3.1 Rea tmplbpe namme, Emplsy ee id sala
,

1EP RIOT Nam i id,alo3


5StP S540P
DE
7 *******************************************************
Projects
8 11 Milan Roy
ssroom n
9 /Ro1l no. 355
10 #include<stdio.h>
Programming
struct student
mming Questions

e are Hiring char name[30]


int rollIno;
Sign Up 5 float sub;
Login
Void main()

struct student s[10]


20 int 1,n;
21 float total=0.0,avg=0.0;
printf("Enter the no: of students ") ;
23
Scant("%d",&n);
24 for(i=0;isn;i++))
25* {printfC"Enter Student details %d", i+1);
printf("\nEnter student name");
27
scanf%5S[l].name);
28
printf("Enter student rollno: ");
29 Scanf(%d", &s[1].rollno);
printf("\nEnter Marks in C programming subject
tots
Scan T&S[ij.st
sub);
52 total+=s[i].sub;
34
avg=total/(float)n;
printf(\nTotal marks of %d Students=%f",n, total):
printi("nAverage marks of %d Students=%f" ,n, avg):
getch():
38

inpu
ma1n.c: 37:9: warning : mpl1cit declaration of function 'getch
Onaec iarat10n ]

getch )
***

Enter the of
no:
student s3
Enter Student details 1
Enter student
nameMilan
Enter student rollno : 25

Enter Marks in C programming subject = 40

Enter Student details 2


Enter student nameJose
Enter student rollno: 23

Enter Marks in C programming subject = 38


Enter Student details S

Enter student nameJuse

Enter student rollno : 53

Enter Marks in C programming subject 28

Tot al marks of 3 Students=106.000000


Average marks of 3 Students =35.333332

Program finished with exit code 0


Press ENTER to exit console.
Sudends

9TEP START

9TEP 2 As51n i loal -0, Aug-


51CP Road th numbn studenb, n

9fEP
1n, gs b sep 5

n a , Holl no.
amb masuk5
4.1 Road
o lal blat + ma k

it+
4.3

lep S avg lolal /


91EP b und Js al amd adg

51E s10P
Run O Debug Stop G Share Save ( Beautify

main.c
for

Online C Compiler.
Code, Compile, Run and Debug C progr
5 Write your code in this editor and press "Run " butto

7 **************
***************************
8 / Milan Roy
9 1/Roll no. 35
10 #include <stdio. h>
11 struct Distance
2
3 int feet;
14 float inch;
15 d i s t 1 , dist2, sum;
main()
17 {
8
printf(" 1st distance\n")
9 printf("Enter feet: ");
0
scanf(%d", &dist1.feet)
21
22 printf("Enter inch: ");
23 scanf("%f", &dist1.inch);
24 printf("2nd distance \n")
25
26 printf("Enter feet: "):
27
scanf("%d", &dist2.feet);
28
29
printf(" Enter inch: ");
Scanf("%f", &dist2.inch);
30
31 // adding feet
32 sum.feet = dist1.feet dist2.feet;
3 adding inches
34 sum.inch = dist1.inch +dist2.inch
35
36 1 changing to feet if inch is greater than 12
37 while (sum. inch>= 12)
38 {
39 t+Sum.feet;
40 sum.inch = sum.inch 12
41
42 printf("Sum of distances = %d\"-%.1f\"", sum.fee
43
44

input
main )

1st distance

Enter feet : 10
Enter inch: 5

|2nd distance
Enter feet : 3
Enter inch: 7

Sum of distances =14' -0.0"

.Program finished with exit code 0


Press ENTER to exit console-|
Alg090 Hhmucbdsan)

9rEP GTART
amb
Read dst(ed, diy ind dr). re
91L0
d inth

97EP gum.Jatt dvs) (d dss . fee

u .Ind-di 1. tn+ dst . inth


9TEP
Gu. 1m Shp 6
STEP 5 ZiL, g0

S. su.Jed Sum. hed


S.1 GuD n h - Sum, inuh-12

dsa n u Sun bed amd sum. ind


51tP 6 pwrd San

9T6P 1 STDP

You might also like