C Programming - Structures

Organized By: Vinay Arora
               Assistant Professor, CSED
               Thapar University, Patiala
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
Program – 1 (output)




                Vinay Arora
                   CSED
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
Program – 2 (output)




                Vinay Arora
                   CSED
Thnx…



  Vinay Arora
     CSED

More Related Content

PDF
C Prog - Strings
PDF
C Prog. - Strings (Updated)
PDF
C Prog - Array
PDF
C programms
DOCX
C lab manaual
DOCX
DataStructures notes
DOCX
SaraPIC
C Prog - Strings
C Prog. - Strings (Updated)
C Prog - Array
C programms
C lab manaual
DataStructures notes
SaraPIC

What's hot (20)

PPSX
C programming array & shorting
DOCX
PPTX
Double linked list
DOCX
Practical File of C Language
PPTX
4. chapter iii
PDF
c-programming-using-pointers
PPTX
Lecture 1 string functions
PPTX
3. chapter ii
DOC
C basics
PPT
All important c programby makhan kumbhkar
DOCX
ADA FILE
PDF
Data Structure using C
DOCX
DAA Lab File C Programs
PPTX
ภาษาซี
DOCX
Data Structures Using C Practical File
PPTX
PDF
programs
PPTX
ภาษาซี
DOC
Basic c programs updated on 31.8.2020
PPTX
Double linked list
C programming array & shorting
Double linked list
Practical File of C Language
4. chapter iii
c-programming-using-pointers
Lecture 1 string functions
3. chapter ii
C basics
All important c programby makhan kumbhkar
ADA FILE
Data Structure using C
DAA Lab File C Programs
ภาษาซี
Data Structures Using C Practical File
programs
ภาษาซี
Basic c programs updated on 31.8.2020
Double linked list

Viewers also liked (20)

PDF
C Tutorial
PDF
Sql tutorial
PDF
C programming tutorial
PDF
C Prog - Functions
PPT
C Prog. - Data Types, Variables and Constants
PDF
C Prog. - ASCII Values, Break, Continue
PPTX
C programming slide-6
PDF
C Prog - Pointers
PDF
C Prog. - Decision & Loop Controls
PDF
CG - Introduction to Computer Graphics
PDF
Search engine and web crawler
PPTX
security and privacy in dbms and in sql database
PDF
C Prog. - Introduction to Hardware, Software, Algorithm & Flowchart
PDF
Advanced SQL - Lecture 6 - Introduction to Databases (1007156ANR)
PDF
Overview of security in DBMS
PDF
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
PPT
Combinational circuits
PDF
Top 100 SQL Interview Questions and Answers
PPSX
INTRODUCTION TO C PROGRAMMING
PDF
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
C Tutorial
Sql tutorial
C programming tutorial
C Prog - Functions
C Prog. - Data Types, Variables and Constants
C Prog. - ASCII Values, Break, Continue
C programming slide-6
C Prog - Pointers
C Prog. - Decision & Loop Controls
CG - Introduction to Computer Graphics
Search engine and web crawler
security and privacy in dbms and in sql database
C Prog. - Introduction to Hardware, Software, Algorithm & Flowchart
Advanced SQL - Lecture 6 - Introduction to Databases (1007156ANR)
Overview of security in DBMS
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
Combinational circuits
Top 100 SQL Interview Questions and Answers
INTRODUCTION TO C PROGRAMMING
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...

Similar to C Prog. - Structures (20)

DOCX
Dti2143 lab sheet 6
DOCX
PDF
C Prog - Array
PPTX
C Language Programming Introduction Lecture
DOCX
Bti1022 lab sheet 7
PPTX
Introduction to Basic C programming 02
PPT
Unit4
PPT
C Language Unit-4
PPTX
c_pro_introduction.pptx
PPTX
Introduction to C Programming language Chapter02.pptx
PDF
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
PPTX
C programming(part 3)
PPTX
Lecture 1 mte 407
PPTX
Lecture 1 mte 407
PPTX
Chap 2 input output dti2143
PPTX
Introduction to c programming
PPTX
Introduction to c programming
PPTX
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
PPTX
unit 1 cpds.pptx
PDF
CP Handout#2
Dti2143 lab sheet 6
C Prog - Array
C Language Programming Introduction Lecture
Bti1022 lab sheet 7
Introduction to Basic C programming 02
Unit4
C Language Unit-4
c_pro_introduction.pptx
Introduction to C Programming language Chapter02.pptx
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
C programming(part 3)
Lecture 1 mte 407
Lecture 1 mte 407
Chap 2 input output dti2143
Introduction to c programming
Introduction to c programming
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
unit 1 cpds.pptx
CP Handout#2

More from vinay arora (20)

DOCX
Use case diagram (airport)
DOCX
Use case diagram
DOCX
Lab exercise questions (AD & CD)
PDF
SEM - UML (1st case study)
PPT
6 java - loop
PPT
4 java - decision
PPT
3 java - variable type
PPT
2 java - operators
PPT
1 java - data type
PPT
Uta005 lecture3
PPT
Uta005 lecture1
PPT
Uta005 lecture2
PPT
Security & Protection
PPT
Process Synchronization
PDF
CG - Output Primitives
PDF
CG - Display Devices
PDF
CG - Input Output Devices
PPT
A&D - UML
PDF
A&D - Object Oriented Design using UML
PPT
A&D - Input Design
Use case diagram (airport)
Use case diagram
Lab exercise questions (AD & CD)
SEM - UML (1st case study)
6 java - loop
4 java - decision
3 java - variable type
2 java - operators
1 java - data type
Uta005 lecture3
Uta005 lecture1
Uta005 lecture2
Security & Protection
Process Synchronization
CG - Output Primitives
CG - Display Devices
CG - Input Output Devices
A&D - UML
A&D - Object Oriented Design using UML
A&D - Input Design

Recently uploaded (20)

PDF
anganwadi services for the b.sc nursing and GNM
PDF
IS1343_2012...........................pdf
PPTX
ACFE CERTIFICATION TRAINING ON LAW.pptx
PDF
faiz-khans about Radiotherapy Physics-02.pdf
PPTX
pharmaceutics-1unit-1-221214121936-550b56aa.pptx
PPTX
GW4 BioMed Candidate Support Webinar 2025
PPTX
Diploma pharmaceutics notes..helps diploma students
PPTX
Approach to a child with acute kidney injury
PDF
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
PPTX
PAIN PATHWAY & MANAGEMENT OF ACUTE AND CHRONIC PAIN SPEAKER: Dr. Rajasekhar ...
PDF
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
DOCX
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
PDF
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
PPTX
Math 2 Quarter 2 Week 1 Matatag Curriculum
PDF
Chevening Scholarship Application and Interview Preparation Guide
PDF
Review of Related Literature & Studies.pdf
PDF
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
PPTX
MMW-CHAPTER-1-final.pptx major Elementary Education
PPTX
CHROMIUM & Glucose Tolerance Factor.pptx
PPTX
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
anganwadi services for the b.sc nursing and GNM
IS1343_2012...........................pdf
ACFE CERTIFICATION TRAINING ON LAW.pptx
faiz-khans about Radiotherapy Physics-02.pdf
pharmaceutics-1unit-1-221214121936-550b56aa.pptx
GW4 BioMed Candidate Support Webinar 2025
Diploma pharmaceutics notes..helps diploma students
Approach to a child with acute kidney injury
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
PAIN PATHWAY & MANAGEMENT OF ACUTE AND CHRONIC PAIN SPEAKER: Dr. Rajasekhar ...
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
Math 2 Quarter 2 Week 1 Matatag Curriculum
Chevening Scholarship Application and Interview Preparation Guide
Review of Related Literature & Studies.pdf
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
MMW-CHAPTER-1-final.pptx major Elementary Education
CHROMIUM & Glucose Tolerance Factor.pptx
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx

C Prog. - Structures

  • 1. C Programming - Structures Organized 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