'C' language notes (a.p)

My Best Collection of 'c' language program Notes.......!!!

‘C’ LANGUAGE




            POP                                     OOP

 ( Procedure Oriented program )           ( Object Oriented Program )



                            FUNCTION



 BUILT IN FUNCTION                    USER DEFINE FUNCTION


1) 1959 – ALGOL ( Algoritham Oriented Language )

2) 1962 – BCPL ( Basic Common Program language )

3) 1972 – Dennis Ritchi ( Bell Laboratory ) [ USA ] ‘‘c’’


                    Turbo C2 – ‘c’
                    Turbo C3 – ‘c’ & ‘C ++’
                      (Tc300)
                        (Tc)

C:Windows>cd.. Enter
C:>Cdtc Enter
C:Tc>CdBin Enter
C:TcBin>Tc Enter

                         Structure of ‘C’ Program

# include<stdio.h>
# include<conio.h>
  Void main ( )
{
Clrscr ( );
Printf (“ Message 1”);


CREATE BY [ A.P ]                    1
‘C’ LANGUAGE


Printf (“ Message 2”); } ( The lines up & down Type “n )
}

   1) Compile – Alt + F9
   2) Run Program – Ctrl + F9
   3) Display Final Output Alt + F5

                             Data Types

   1) Integer – Number without Decimal
                Range- ( -31768 to +31767 )
                Format- ( % d )
                Memory size- 2 Byte
                Example- int a,b

   2) Float – Decimal Values
              Range- 10-38 to 1038
              Memory size- 4 byte
              Format- ( % f )
              Example- float x,y

   3) Double- Range-10-38 to 10308
              Memory size- 8 bytes
              Format- ( % l d )
              Example- double a,b

   4) Long Double – Memory size- 10 byte
                    Format- ( %L )
                    Example- x,y

   5) Character- Memory size- 1 byte
                 Format- ( % c ) For one Letter
                         ( % s ) For strength

                           Program 1

   #include<stdio.h>
   #include<conio.h>
   void main ()
   {

CREATE BY [ A.P ]                     2
‘C’ LANGUAGE


   int num1,num2,c;
   clrscr();
   num1=20;
   num2=2;
   c=num1+num2;
   printf("nTotal=%d",c);
   c=num1-num2;
   printf("nSub=%d",c);
   c=num1*num2;
   printf("nMul=%d",c);
   c=num1/num2;
   printf("nDiv=%d",c);
   getch();
   }

                                Program 2

   #include<stdio.h>
   #include<conio.h>
   void main ()
   {
   int num1,num2,c;
   printf("nEnter 1st no.");
   scanf("%d",&num1);
   printf("nEnter 2nd no.");
   scanf("%d",&num2);
   c=num1+num2;
   printf("nTotal=%d",c);
   getch();
   }

                                Operator

   1) Arithmetic operator - +, -, *, / , %
                            A = 100 % 6
                            Output A = 4

   2) Relational Operator - < - Less than
                            > - Greter than
                            < = = - Less than equal to

CREATE BY [ A.P ]                      3
‘C’ LANGUAGE


                             < = = - Greter than equal to
                             = = - Equal to
                             ! = - Not equal to

   3) Logical operator – 1) &&- And
                         2) | | - Or
                         3) ! - Not operator

   4) Unary operator – 1) + + - Inerement operator
                       2) - - - Decrement operator

   5) Assignment operator – ( = )
                            A = A+5 – A + = 5
                            A = A-3 - A - = 3
                            A = A*2 - A * = 2

   6) Size of operator – Long double x;
                         Int a;
                         A = size of ( x );

                             Program 3

   #include<stdio.h>
   #include<conio.h>
   void main()
   {
   int h,e,m,tot;
   float per;
   clrscr();
   printf("nEnter marks of 3 subjects:");
   scanf("%d%d%d",&h,&e,&m);
   tot=h+e+m;
   per=((float)tot/300)*100;
   printf("nTotal=%d",tot);
   printf("nper=%f",per);
   if(per>60)
   printf("nFrist");
   else if(per>45&&per<60)
   printf("nSecond");
   else if (per>=36&&per<45)

CREATE BY [ A.P ]                      4
‘C’ LANGUAGE


   printf("nThird");
   else
   printf("nFail");
   getch();
   }

                               Program 4

   #include<stdio.h>
   #include<conio.h>
   void main ()
   {
   int a,b,c;
   clrscr();
   printf("nEnter 3 Numbers:");
   scanf("%d%d%d",&a,&b,&c);
   if (a>b&&a>c)
   printf("nA=%d",a);
   else if (b>a&&b>c)
   printf("nB=%d",b);
   else
   printf("nC=%d",c);
   getch();
   }

                               Program 5

   #include<stdio.h>
   #include<conio.h>
   void main ()
   {
   char ch;
   clrscr();
   printf("nEnter one Letter:");
   scanf("n%c",&ch);
   if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
   printf("nLetter is vowel");
   else
   printf("nEnter is not vowel");
   getch();

CREATE BY [ A.P ]                       5
‘C’ LANGUAGE


   }
                            Program 6

   #include<stdio.h>
   #include<conio.h>
   void main ()
   {
   int year;
   clrscr();
   printf("nEnter Year");
   scanf("%d",&year);
   if(year%4==0)
   printf("nLeap Year");
   else
   printf("nNot leap Year");
   getch();
   }

                            Program 7

   #include<stdio.h>
   #include<conio.h>
   void main ()
   {
   int a;
   clrscr();
   a=1;
   while(a<=10)
   {
   printf("n%d",a);
   a++;
   }
   getch();
   }

                            Program 8

   #include<stdio.h>
   #include<conio.h>
   void main ()

CREATE BY [ A.P ]                  6
‘C’ LANGUAGE


   {
   int a,sum=0;
   clrscr();
   a=1;
   while(a<=10)
   {
   printf("n%d",a);
   sum=sum+a;
   a++;
   }
   printf("nTotal=%d",sum);
   getch();
   }

                           Program 9

   #include<stdio.h>
   #include<conio.h>
   void main()
   {
   int a;
   clrscr();
   a=10;
   while(a>=1)
   {
   printf("n%d",a);
   a--;
   }
   getch();
   }

                           Program 10

   #include<stdio.h>
   #include<conio.h>
   void main ()
   {
   int a;
   clrscr();
   a=1000;

CREATE BY [ A.P ]                 7
‘C’ LANGUAGE


   while(a>=1)
   {
   printf("n%d",a);
   a=a/2;
   }
   getch();
   }

                           Program 11

   #include<stdio.h>
   #include<conio.h>
   void main()
   {
   int a,b;
   clrscr();
   a=1;
   while(a<=10)
   {
   b=a*a;
   printf("n%d",b);
   a++;
   }
   getch();
   }

                           Program 12

   #include<stdio.h>
   #include<conio.h>
   void main()
   {
   int a,b,c;
   clrscr();
   printf("nEnter Number:");
   scanf("%d",&a);
   b=1;
   while(b<=10)
   {
   c=a*b;

CREATE BY [ A.P ]                 8
‘C’ LANGUAGE


   printf("n%d",c);
   b++;
   }
   getch();
   }

                            Program 13

   #include<stdio.h>
   #include<conio.h>
   void main()
   {
   int a,b,x,i;
   clrscr();
   a=0;
   b=1;
   printf("n%d",a);
   printf("n%d",b);
   i=1;
   while(i<=10)
   {
   x=a+b;
   printf("n%d",x);
   a=b;
   b=x;
   i++;
   }
   getch();
   }

                            Program 14

   #include<stdio.h>
   #include<conio.h>
   void main()
   {
   int a,b,even=0,odd=0;
   clrscr();
   a=1;
   while(a<=25)

CREATE BY [ A.P ]                  9
‘C’ LANGUAGE


   {
   printf("n%d",a);
   b=a%2;
   if(b==0)
   even=even+a;
   else
   odd=odd+a;
   a++;
   }
   printf("nEven Total=%d",even);
   printf("nOdd Total=%d",odd);
   getch();
   }

                            Program 15

   #include<stdio.h>
   #include<conio.h>
   void main()
   {
   int a,fact;
   clrscr();
   printf("nEnter no.");
   scanf("%d",&a);
   fact=1;
   while(a>0)
   {
   fact=fact*a;
   a--;
   }
   printf("nFactorial No:=%d",fact);
   getch();
   }

                            Program 16

   #include<stdio.h>
   #include<conio.h>
    void main()
    {

CREATE BY [ A.P ]                    10
‘C’ LANGUAGE


   int a;
   clrscr();
   a=9+5*4-3*4/2;
   printf("%d",a);
   getch();
   }

                        Program 17

   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int a;
    clrscr();
    a=-9+4;
    printf("%d",a);
    getch();
    }

                        Program 18

   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int a=5,b=7,c;
    clrscr();
    c=a<b;
    printf("%d",c);
    getch();
    }

                        Program 19

   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int a=5;

CREATE BY [ A.P ]              11
‘C’ LANGUAGE


   clrscr();
   while(a)
   {
   printf("n Ram");
   a--;
   }
   getch();
   }

                           Program 20

   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int a,b,c;
    clrscr();
    printf("nEnter Two Number:");
    scanf("%d%d",&a,&b);
    printf("1-Add,2-Sub,3-Mul,4-Div");
    printf("nEnter Choice:");
    scanf("%d",&c);
    switch(c)
    {
    case 1:
    printf("nTotal=%d",a+b);
    break;
    case 2:
    printf("nSub=%d",a-b);
    break;
    case 3:
    printf("nMul=%d",a*b);
    break;
    case 4:
    printf("nDiv=%d",a/b);
    break;
    default:
    printf("nInvalid Number");
    }
    getch();

CREATE BY [ A.P ]                  12
‘C’ LANGUAGE


   }
                          Program 21

   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int a;
    clrscr();
    a=1;
    do
    {
    printf("n%d",a);
    a++;
    }
    while(a<=10);
    getch();
    }

                          Program 22

   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int a;
    clrscr();
    for(a=1;a<=10;a++)
    {
    printf("n%d",a);
    }
    getch();
    }

                          Program 23

   #include<stdio.h>
   #include<conio.h>
    void main()
    {

CREATE BY [ A.P ]                13
‘C’ LANGUAGE


   int a,b,c;
   clrscr();
   printf("nEnter Number:");
   scanf("%d",&a);
   for (b=1;b<=10;b++)
   {
   c=a*b;
   printf("n%d",c);
   }
   getch();
   }

                              Program 24

   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int a,b;
    clrscr();
    for(a=1;a<5;a++)
    {
    for(b=1;b<a;b++)
    {
    printf("%d",b);
    }
    printf("n");
    }
    getch();
    }

                              Program 25

   #include<stdio.h>
   #include<conio.h>
   void main()
   {
   char name[15];
   clrscr();
   printf("nEnter Name:");

CREATE BY [ A.P ]                    14
‘C’ LANGUAGE


   gets(name);
   printf("nyour name=%s",name);
   getch();
   }

                              Program 26

   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int x[5],a;
    clrscr();
    for(a=0;a<=4;a++)
    {
    printf("nEnter No:");
    scanf("%d",&x[a]);
    }
    for(a=0;a<4;a++)
    {
    printf("n%d",x[a]);
    }
    getch();
    }




CREATE BY [ A.P ]                    15
‘C’ LANGUAGE




CREATE BY [ A.P ]          16

Recomendados

20 C programs por
20 C programs20 C programs
20 C programsnavjoth
5.4K vistas25 diapositivas
C notes.pdf por
C notes.pdfC notes.pdf
C notes.pdfDurga Padma
41.5K vistas24 diapositivas
C programming language tutorial por
C programming language tutorial C programming language tutorial
C programming language tutorial javaTpoint s
2.2K vistas47 diapositivas
C programming language por
C programming languageC programming language
C programming languageMahmoud Eladawi
1.8K vistas149 diapositivas
C Language (All Concept) por
C Language (All Concept)C Language (All Concept)
C Language (All Concept)sachindane
2.3K vistas60 diapositivas
OpenGurukul : Language : C Programming por
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpen Gurukul
5.4K vistas144 diapositivas

Más contenido relacionado

La actualidad más candente

Complete C programming Language Course por
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language CourseVivek chan
5.8K vistas299 diapositivas
C Programming Language Tutorial for beginners - JavaTpoint por
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointJavaTpoint.Com
22.8K vistas39 diapositivas
Introduction to c programming por
Introduction to c programmingIntroduction to c programming
Introduction to c programminggajendra singh
2.8K vistas74 diapositivas
C program por
C programC program
C programAJAL A J
4.4K vistas161 diapositivas
C Programming Tutorial - www.infomtec.com por
C Programming Tutorial - www.infomtec.comC Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.comM-TEC Computer Education
726 vistas53 diapositivas
C language (Collected By Dushmanta) por
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)Dushmanta Nath
7.9K vistas310 diapositivas

La actualidad más candente(20)

Complete C programming Language Course por Vivek chan
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language Course
Vivek chan5.8K vistas
C Programming Language Tutorial for beginners - JavaTpoint por JavaTpoint.Com
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
JavaTpoint.Com22.8K vistas
Introduction to c programming por gajendra singh
Introduction to c programmingIntroduction to c programming
Introduction to c programming
gajendra singh 2.8K vistas
C program por AJAL A J
C programC program
C program
AJAL A J4.4K vistas
C language (Collected By Dushmanta) por Dushmanta Nath
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
Dushmanta Nath7.9K vistas
Fundamental of C Programming Language and Basic Input/Output Function por imtiazalijoono
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
imtiazalijoono499 vistas
Basics of C programming por avikdhupar
Basics of C programmingBasics of C programming
Basics of C programming
avikdhupar165.1K vistas
Introduction to Basic C programming 01 por Wingston
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
Wingston6.5K vistas
Tutorial on c language programming por Sudheer Kiran
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programming
Sudheer Kiran1.7K vistas
C the basic concepts por Abhinav Vatsa
C the basic conceptsC the basic concepts
C the basic concepts
Abhinav Vatsa58.2K vistas
Introduction to Basic C programming 02 por Wingston
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
Wingston9.4K vistas
Unit 4 Foc por JAYA
Unit 4 FocUnit 4 Foc
Unit 4 Foc
JAYA3.1K vistas
Overview of c++ language por samt7
Overview of c++ language   Overview of c++ language
Overview of c++ language
samt72.3K vistas

Destacado

best notes in c language por
best notes in c languagebest notes in c language
best notes in c languageIndia
12.8K vistas128 diapositivas
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order por
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit orderMalikireddy Bramhananda Reddy
3.3K vistas136 diapositivas
Handwritten Notes (c) por
Handwritten Notes (c)Handwritten Notes (c)
Handwritten Notes (c)Obama White House
10.3K vistas1 diapositiva
Arrays In C Language por
Arrays In C LanguageArrays In C Language
Arrays In C LanguageSurbhi Yadav
2.4K vistas17 diapositivas
Arrays in C language por
Arrays in C languageArrays in C language
Arrays in C languageShubham Sharma
7.5K vistas28 diapositivas
datatypes and variables in c language por
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c languageRai University
8.9K vistas66 diapositivas

Destacado(10)

best notes in c language por India
best notes in c languagebest notes in c language
best notes in c language
India12.8K vistas
Arrays In C Language por Surbhi Yadav
Arrays In C LanguageArrays In C Language
Arrays In C Language
Surbhi Yadav2.4K vistas
datatypes and variables in c language por Rai University
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
Rai University8.9K vistas
physics-of-vibration-and-waves-solutions-pain por miranteogbonna
 physics-of-vibration-and-waves-solutions-pain physics-of-vibration-and-waves-solutions-pain
physics-of-vibration-and-waves-solutions-pain
miranteogbonna51.8K vistas
Array in c language por home
Array in c languageArray in c language
Array in c language
home42K vistas

Similar a 'C' language notes (a.p)

C basics por
C basicsC basics
C basicsMSc CST
322 vistas25 diapositivas
C Programming por
C ProgrammingC Programming
C ProgrammingSumant Diwakar
4.3K vistas34 diapositivas
C Programming Example por
C Programming ExampleC Programming Example
C Programming ExamplePRATHAMESH DESHPANDE
3.4K vistas6 diapositivas
C por
CC
CMukund Trivedi
804 vistas24 diapositivas
Simple C programs por
Simple C programsSimple C programs
Simple C programsab11cs001
3.1K vistas128 diapositivas
Hargun por
HargunHargun
HargunMukund Trivedi
501 vistas24 diapositivas

Similar a 'C' language notes (a.p)(20)

C basics por MSc CST
C basicsC basics
C basics
MSc CST322 vistas
Simple C programs por ab11cs001
Simple C programsSimple C programs
Simple C programs
ab11cs0013.1K vistas
SaraPIC por Sara Sahu
SaraPICSaraPIC
SaraPIC
Sara Sahu549 vistas
Core programming in c por Rahul Pandit
Core programming in cCore programming in c
Core programming in c
Rahul Pandit6.2K vistas
Chapter 8 c solution por Azhar Javed
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
Azhar Javed9.1K vistas
Basic c programs updated on 31.8.2020 por vrgokila
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
vrgokila147 vistas
Practical write a c program to reverse a given number por Mainak Sasmal
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal9.9K vistas
Practical write a c program to reverse a given number por Mainak Sasmal
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal2.4K vistas
LET US C (5th EDITION) CHAPTER 2 ANSWERS por KavyaSharma65
LET US C (5th EDITION) CHAPTER 2 ANSWERSLET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERS
KavyaSharma65574 vistas
Best C Programming Solution por yogini sharma
Best C Programming SolutionBest C Programming Solution
Best C Programming Solution
yogini sharma610 vistas
Data Structure using C por Bilal Mirza
Data Structure using CData Structure using C
Data Structure using C
Bilal Mirza914 vistas

Último

CASE 1850K Tier 3 Crawler Dozer Service Repair Manual Instant Download.pdf por
CASE 1850K Tier 3 Crawler Dozer Service Repair Manual Instant Download.pdfCASE 1850K Tier 3 Crawler Dozer Service Repair Manual Instant Download.pdf
CASE 1850K Tier 3 Crawler Dozer Service Repair Manual Instant Download.pdfgongyi2122252
6 vistas25 diapositivas
Compact Capacitance Level Switch.pdf por
Compact Capacitance Level Switch.pdfCompact Capacitance Level Switch.pdf
Compact Capacitance Level Switch.pdfTrumen Technologies Pvt. Ltd. India
5 vistas1 diapositiva
Caterpillar Cat 313D2 and 313D2 GC Excavator (Prefix FAP) Service Repair Manu... por
Caterpillar Cat 313D2 and 313D2 GC Excavator (Prefix FAP) Service Repair Manu...Caterpillar Cat 313D2 and 313D2 GC Excavator (Prefix FAP) Service Repair Manu...
Caterpillar Cat 313D2 and 313D2 GC Excavator (Prefix FAP) Service Repair Manu...zan2736ban
18 vistas28 diapositivas
2006 TOYOTA COROLLA Service Repair Manual.pdf por
2006 TOYOTA COROLLA Service Repair Manual.pdf2006 TOYOTA COROLLA Service Repair Manual.pdf
2006 TOYOTA COROLLA Service Repair Manual.pdfxqpa81165737
5 vistas18 diapositivas
GER 41-K/NL por
GER 41-K/NLGER 41-K/NL
GER 41-K/NLJibbeHeetkamp
40 vistas8 diapositivas
Caterpillar Cat 325C EXCAVATOR (Prefix BLX) Service Repair Manual Instant Dow... por
Caterpillar Cat 325C EXCAVATOR (Prefix BLX) Service Repair Manual Instant Dow...Caterpillar Cat 325C EXCAVATOR (Prefix BLX) Service Repair Manual Instant Dow...
Caterpillar Cat 325C EXCAVATOR (Prefix BLX) Service Repair Manual Instant Dow...zan2736ban
6 vistas30 diapositivas

Último(20)

CASE 1850K Tier 3 Crawler Dozer Service Repair Manual Instant Download.pdf por gongyi2122252
CASE 1850K Tier 3 Crawler Dozer Service Repair Manual Instant Download.pdfCASE 1850K Tier 3 Crawler Dozer Service Repair Manual Instant Download.pdf
CASE 1850K Tier 3 Crawler Dozer Service Repair Manual Instant Download.pdf
gongyi21222526 vistas
Caterpillar Cat 313D2 and 313D2 GC Excavator (Prefix FAP) Service Repair Manu... por zan2736ban
Caterpillar Cat 313D2 and 313D2 GC Excavator (Prefix FAP) Service Repair Manu...Caterpillar Cat 313D2 and 313D2 GC Excavator (Prefix FAP) Service Repair Manu...
Caterpillar Cat 313D2 and 313D2 GC Excavator (Prefix FAP) Service Repair Manu...
zan2736ban18 vistas
2006 TOYOTA COROLLA Service Repair Manual.pdf por xqpa81165737
2006 TOYOTA COROLLA Service Repair Manual.pdf2006 TOYOTA COROLLA Service Repair Manual.pdf
2006 TOYOTA COROLLA Service Repair Manual.pdf
xqpa811657375 vistas
Caterpillar Cat 325C EXCAVATOR (Prefix BLX) Service Repair Manual Instant Dow... por zan2736ban
Caterpillar Cat 325C EXCAVATOR (Prefix BLX) Service Repair Manual Instant Dow...Caterpillar Cat 325C EXCAVATOR (Prefix BLX) Service Repair Manual Instant Dow...
Caterpillar Cat 325C EXCAVATOR (Prefix BLX) Service Repair Manual Instant Dow...
zan2736ban6 vistas
2005 Kawasaki KVF700D1 Prairie Factory Service Manual.pdf por rte638359
2005 Kawasaki KVF700D1 Prairie Factory Service Manual.pdf2005 Kawasaki KVF700D1 Prairie Factory Service Manual.pdf
2005 Kawasaki KVF700D1 Prairie Factory Service Manual.pdf
rte6383595 vistas
Caterpillar Cat 312C and 312C L Excavator (Prefix CBA) Service Repair Manual ... por zan2736ban
Caterpillar Cat 312C and 312C L Excavator (Prefix CBA) Service Repair Manual ...Caterpillar Cat 312C and 312C L Excavator (Prefix CBA) Service Repair Manual ...
Caterpillar Cat 312C and 312C L Excavator (Prefix CBA) Service Repair Manual ...
zan2736ban9 vistas
Caterpillar Cat 938G WHEEL LOADER (Prefix 9HS) Service Repair Manual (9HS0000... por rong74gou
Caterpillar Cat 938G WHEEL LOADER (Prefix 9HS) Service Repair Manual (9HS0000...Caterpillar Cat 938G WHEEL LOADER (Prefix 9HS) Service Repair Manual (9HS0000...
Caterpillar Cat 938G WHEEL LOADER (Prefix 9HS) Service Repair Manual (9HS0000...
rong74gou21 vistas
JCB 5CX Wastemaster Eco Backhoe Loader Service Repair Manual SN from 2442701 ... por rong74gou
JCB 5CX Wastemaster Eco Backhoe Loader Service Repair Manual SN from 2442701 ...JCB 5CX Wastemaster Eco Backhoe Loader Service Repair Manual SN from 2442701 ...
JCB 5CX Wastemaster Eco Backhoe Loader Service Repair Manual SN from 2442701 ...
rong74gou5 vistas
Volvo A25E Articulated Dump Truck Service Repair Manual Instant Download.pdf por zu0582kui
Volvo A25E Articulated Dump Truck Service Repair Manual Instant Download.pdfVolvo A25E Articulated Dump Truck Service Repair Manual Instant Download.pdf
Volvo A25E Articulated Dump Truck Service Repair Manual Instant Download.pdf
zu0582kui9 vistas
294196410-investigatoy-project-on-application-of-biotechnology.docx por maiyadeengupta94
294196410-investigatoy-project-on-application-of-biotechnology.docx294196410-investigatoy-project-on-application-of-biotechnology.docx
294196410-investigatoy-project-on-application-of-biotechnology.docx
maiyadeengupta947 vistas
Caterpillar Cat 336D L Excavator (Prefix LMG) Service Repair Manual Instant D... por zan2736ban
Caterpillar Cat 336D L Excavator (Prefix LMG) Service Repair Manual Instant D...Caterpillar Cat 336D L Excavator (Prefix LMG) Service Repair Manual Instant D...
Caterpillar Cat 336D L Excavator (Prefix LMG) Service Repair Manual Instant D...
zan2736ban6 vistas
Caterpillar Cat D7G TRACK-TYPE TRACTOR (Prefix 72W) Service Repair Manual Ins... por ze3xiandiao
Caterpillar Cat D7G TRACK-TYPE TRACTOR (Prefix 72W) Service Repair Manual Ins...Caterpillar Cat D7G TRACK-TYPE TRACTOR (Prefix 72W) Service Repair Manual Ins...
Caterpillar Cat D7G TRACK-TYPE TRACTOR (Prefix 72W) Service Repair Manual Ins...
ze3xiandiao7 vistas
Caterpillar Cat 140H Motor Grader (Prefix 8KM) Service Repair Manual (8KM0000... por rong74gou
Caterpillar Cat 140H Motor Grader (Prefix 8KM) Service Repair Manual (8KM0000...Caterpillar Cat 140H Motor Grader (Prefix 8KM) Service Repair Manual (8KM0000...
Caterpillar Cat 140H Motor Grader (Prefix 8KM) Service Repair Manual (8KM0000...
rong74gou14 vistas
Caterpillar Cat 938G WHEEL LOADER (Prefix 8RS) Service Repair Manual (8RS0061... por rong74gou
Caterpillar Cat 938G WHEEL LOADER (Prefix 8RS) Service Repair Manual (8RS0061...Caterpillar Cat 938G WHEEL LOADER (Prefix 8RS) Service Repair Manual (8RS0061...
Caterpillar Cat 938G WHEEL LOADER (Prefix 8RS) Service Repair Manual (8RS0061...
rong74gou14 vistas
Caterpillar Cat D7G TRACK-TYPE TRACTOR (Prefix 35N) Service Repair Manual Ins... por ze3xiandiao
Caterpillar Cat D7G TRACK-TYPE TRACTOR (Prefix 35N) Service Repair Manual Ins...Caterpillar Cat D7G TRACK-TYPE TRACTOR (Prefix 35N) Service Repair Manual Ins...
Caterpillar Cat D7G TRACK-TYPE TRACTOR (Prefix 35N) Service Repair Manual Ins...
ze3xiandiao18 vistas
2002 ACURA RSX Service Repair Manual.pdf por xwm10319888
2002 ACURA RSX Service Repair Manual.pdf2002 ACURA RSX Service Repair Manual.pdf
2002 ACURA RSX Service Repair Manual.pdf
xwm103198885 vistas
Volvo A30D Articulated Dump Truck Service Repair Manual Instant Download.pdf por zu0582kui
Volvo A30D Articulated Dump Truck Service Repair Manual Instant Download.pdfVolvo A30D Articulated Dump Truck Service Repair Manual Instant Download.pdf
Volvo A30D Articulated Dump Truck Service Repair Manual Instant Download.pdf
zu0582kui5 vistas

'C' language notes (a.p)

  • 1. ‘C’ LANGUAGE POP OOP ( Procedure Oriented program ) ( Object Oriented Program ) FUNCTION BUILT IN FUNCTION USER DEFINE FUNCTION 1) 1959 – ALGOL ( Algoritham Oriented Language ) 2) 1962 – BCPL ( Basic Common Program language ) 3) 1972 – Dennis Ritchi ( Bell Laboratory ) [ USA ] ‘‘c’’ Turbo C2 – ‘c’ Turbo C3 – ‘c’ & ‘C ++’ (Tc300) (Tc) C:Windows>cd.. Enter C:>Cdtc Enter C:Tc>CdBin Enter C:TcBin>Tc Enter Structure of ‘C’ Program # include<stdio.h> # include<conio.h> Void main ( ) { Clrscr ( ); Printf (“ Message 1”); CREATE BY [ A.P ] 1
  • 2. ‘C’ LANGUAGE Printf (“ Message 2”); } ( The lines up & down Type “n ) } 1) Compile – Alt + F9 2) Run Program – Ctrl + F9 3) Display Final Output Alt + F5 Data Types 1) Integer – Number without Decimal Range- ( -31768 to +31767 ) Format- ( % d ) Memory size- 2 Byte Example- int a,b 2) Float – Decimal Values Range- 10-38 to 1038 Memory size- 4 byte Format- ( % f ) Example- float x,y 3) Double- Range-10-38 to 10308 Memory size- 8 bytes Format- ( % l d ) Example- double a,b 4) Long Double – Memory size- 10 byte Format- ( %L ) Example- x,y 5) Character- Memory size- 1 byte Format- ( % c ) For one Letter ( % s ) For strength Program 1 #include<stdio.h> #include<conio.h> void main () { CREATE BY [ A.P ] 2
  • 3. ‘C’ LANGUAGE int num1,num2,c; clrscr(); num1=20; num2=2; c=num1+num2; printf("nTotal=%d",c); c=num1-num2; printf("nSub=%d",c); c=num1*num2; printf("nMul=%d",c); c=num1/num2; printf("nDiv=%d",c); getch(); } Program 2 #include<stdio.h> #include<conio.h> void main () { int num1,num2,c; printf("nEnter 1st no."); scanf("%d",&num1); printf("nEnter 2nd no."); scanf("%d",&num2); c=num1+num2; printf("nTotal=%d",c); getch(); } Operator 1) Arithmetic operator - +, -, *, / , % A = 100 % 6 Output A = 4 2) Relational Operator - < - Less than > - Greter than < = = - Less than equal to CREATE BY [ A.P ] 3
  • 4. ‘C’ LANGUAGE < = = - Greter than equal to = = - Equal to ! = - Not equal to 3) Logical operator – 1) &&- And 2) | | - Or 3) ! - Not operator 4) Unary operator – 1) + + - Inerement operator 2) - - - Decrement operator 5) Assignment operator – ( = ) A = A+5 – A + = 5 A = A-3 - A - = 3 A = A*2 - A * = 2 6) Size of operator – Long double x; Int a; A = size of ( x ); Program 3 #include<stdio.h> #include<conio.h> void main() { int h,e,m,tot; float per; clrscr(); printf("nEnter marks of 3 subjects:"); scanf("%d%d%d",&h,&e,&m); tot=h+e+m; per=((float)tot/300)*100; printf("nTotal=%d",tot); printf("nper=%f",per); if(per>60) printf("nFrist"); else if(per>45&&per<60) printf("nSecond"); else if (per>=36&&per<45) CREATE BY [ A.P ] 4
  • 5. ‘C’ LANGUAGE printf("nThird"); else printf("nFail"); getch(); } Program 4 #include<stdio.h> #include<conio.h> void main () { int a,b,c; clrscr(); printf("nEnter 3 Numbers:"); scanf("%d%d%d",&a,&b,&c); if (a>b&&a>c) printf("nA=%d",a); else if (b>a&&b>c) printf("nB=%d",b); else printf("nC=%d",c); getch(); } Program 5 #include<stdio.h> #include<conio.h> void main () { char ch; clrscr(); printf("nEnter one Letter:"); scanf("n%c",&ch); if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u') printf("nLetter is vowel"); else printf("nEnter is not vowel"); getch(); CREATE BY [ A.P ] 5
  • 6. ‘C’ LANGUAGE } Program 6 #include<stdio.h> #include<conio.h> void main () { int year; clrscr(); printf("nEnter Year"); scanf("%d",&year); if(year%4==0) printf("nLeap Year"); else printf("nNot leap Year"); getch(); } Program 7 #include<stdio.h> #include<conio.h> void main () { int a; clrscr(); a=1; while(a<=10) { printf("n%d",a); a++; } getch(); } Program 8 #include<stdio.h> #include<conio.h> void main () CREATE BY [ A.P ] 6
  • 7. ‘C’ LANGUAGE { int a,sum=0; clrscr(); a=1; while(a<=10) { printf("n%d",a); sum=sum+a; a++; } printf("nTotal=%d",sum); getch(); } Program 9 #include<stdio.h> #include<conio.h> void main() { int a; clrscr(); a=10; while(a>=1) { printf("n%d",a); a--; } getch(); } Program 10 #include<stdio.h> #include<conio.h> void main () { int a; clrscr(); a=1000; CREATE BY [ A.P ] 7
  • 8. ‘C’ LANGUAGE while(a>=1) { printf("n%d",a); a=a/2; } getch(); } Program 11 #include<stdio.h> #include<conio.h> void main() { int a,b; clrscr(); a=1; while(a<=10) { b=a*a; printf("n%d",b); a++; } getch(); } Program 12 #include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf("nEnter Number:"); scanf("%d",&a); b=1; while(b<=10) { c=a*b; CREATE BY [ A.P ] 8
  • 9. ‘C’ LANGUAGE printf("n%d",c); b++; } getch(); } Program 13 #include<stdio.h> #include<conio.h> void main() { int a,b,x,i; clrscr(); a=0; b=1; printf("n%d",a); printf("n%d",b); i=1; while(i<=10) { x=a+b; printf("n%d",x); a=b; b=x; i++; } getch(); } Program 14 #include<stdio.h> #include<conio.h> void main() { int a,b,even=0,odd=0; clrscr(); a=1; while(a<=25) CREATE BY [ A.P ] 9
  • 10. ‘C’ LANGUAGE { printf("n%d",a); b=a%2; if(b==0) even=even+a; else odd=odd+a; a++; } printf("nEven Total=%d",even); printf("nOdd Total=%d",odd); getch(); } Program 15 #include<stdio.h> #include<conio.h> void main() { int a,fact; clrscr(); printf("nEnter no."); scanf("%d",&a); fact=1; while(a>0) { fact=fact*a; a--; } printf("nFactorial No:=%d",fact); getch(); } Program 16 #include<stdio.h> #include<conio.h> void main() { CREATE BY [ A.P ] 10
  • 11. ‘C’ LANGUAGE int a; clrscr(); a=9+5*4-3*4/2; printf("%d",a); getch(); } Program 17 #include<stdio.h> #include<conio.h> void main() { int a; clrscr(); a=-9+4; printf("%d",a); getch(); } Program 18 #include<stdio.h> #include<conio.h> void main() { int a=5,b=7,c; clrscr(); c=a<b; printf("%d",c); getch(); } Program 19 #include<stdio.h> #include<conio.h> void main() { int a=5; CREATE BY [ A.P ] 11
  • 12. ‘C’ LANGUAGE clrscr(); while(a) { printf("n Ram"); a--; } getch(); } Program 20 #include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf("nEnter Two Number:"); scanf("%d%d",&a,&b); printf("1-Add,2-Sub,3-Mul,4-Div"); printf("nEnter Choice:"); scanf("%d",&c); switch(c) { case 1: printf("nTotal=%d",a+b); break; case 2: printf("nSub=%d",a-b); break; case 3: printf("nMul=%d",a*b); break; case 4: printf("nDiv=%d",a/b); break; default: printf("nInvalid Number"); } getch(); CREATE BY [ A.P ] 12
  • 13. ‘C’ LANGUAGE } Program 21 #include<stdio.h> #include<conio.h> void main() { int a; clrscr(); a=1; do { printf("n%d",a); a++; } while(a<=10); getch(); } Program 22 #include<stdio.h> #include<conio.h> void main() { int a; clrscr(); for(a=1;a<=10;a++) { printf("n%d",a); } getch(); } Program 23 #include<stdio.h> #include<conio.h> void main() { CREATE BY [ A.P ] 13
  • 14. ‘C’ LANGUAGE int a,b,c; clrscr(); printf("nEnter Number:"); scanf("%d",&a); for (b=1;b<=10;b++) { c=a*b; printf("n%d",c); } getch(); } Program 24 #include<stdio.h> #include<conio.h> void main() { int a,b; clrscr(); for(a=1;a<5;a++) { for(b=1;b<a;b++) { printf("%d",b); } printf("n"); } getch(); } Program 25 #include<stdio.h> #include<conio.h> void main() { char name[15]; clrscr(); printf("nEnter Name:"); CREATE BY [ A.P ] 14
  • 15. ‘C’ LANGUAGE gets(name); printf("nyour name=%s",name); getch(); } Program 26 #include<stdio.h> #include<conio.h> void main() { int x[5],a; clrscr(); for(a=0;a<=4;a++) { printf("nEnter No:"); scanf("%d",&x[a]); } for(a=0;a<4;a++) { printf("n%d",x[a]); } getch(); } CREATE BY [ A.P ] 15