Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# C Prog. - Structures

621

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
621
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
38
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. C Programming - StructuresOrganized By: Vinay Arora Assistant Professor, CSED Thapar University, Patiala
• 2. Program - 1 #include<stdio.h> getch(); #include<conio.h> } void main() { char name[3]; float price[3],i; clrscr(); printf("Enter names, price of 3 booksn"); for(i=0;i<=2;i++) scanf("n%c %f",&name[i],&price[i]); printf("nAnd this is what you have enteredn"); for(i=0;i<=2;i++) printf("%c %fn",name[i],price[i]); Vinay Arora CSED
• 3. Program – 1 (output) Vinay Arora CSED
• 4. Program - 2 #include<stdio.h> printf("nAnd this is what you have enteredn"); #include<conio.h> printf("n%c %f",b1.name,b1.price); void main() printf("n%c %f",b2.name,b2.price); { printf("n%c %f",b3.name,b3.price); struct book { getch(); char name; } float price; }; struct book b1,b2,b3; clrscr(); printf("Enter names, price of 3 booksn"); scanf("n%c %f",&b1.name,&b1.price); scanf("n%c %f",&b2.name,&b2.price); scanf("n%c %f",&b3.name,&b3.price); Vinay Arora CSED
• 5. Program – 2 (output) Vinay Arora CSED
• 6. Thnx… Vinay Arora CSED