100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
College aantekeningen

Computer system

Beoordeling
-
Verkocht
-
Pagina's
30
Geüpload op
24-07-2023
Geschreven in
2017/2018

Computer system, computer science, computer skills, computer language

Instelling
Vak










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Study Level
Publisher
Subject
Course

Documentinformatie

Geüpload op
24 juli 2023
Aantal pagina's
30
Geschreven in
2017/2018
Type
College aantekeningen
Docent(en)
Prof
Bevat
Alle colleges

Onderwerpen

Voorbeeld van de inhoud

Program using strcat() function.

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

char str1[10]="jbrec";

char str2[]="ece";

strcat(str1,str2);

printf("%s\n",str1);

printf("%s\n",str2);

getch();

}



OUTPUT : jbrecece

ece

7 : strrev(string) - String Reverse :This function is used to reverse a string. This function takes
only one argument and return one argument.

Syntax : strrev(string);

Ex : Program using strrev() function

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{


C PROGRAMMING Page 131

,char str[20];

printf("Enter the string:");

scanf("%s",str);

printf("The string reversed is:%s",strrev(str));

getch();

}



OUTPUT : Enter the string :subbareddy

The string reversed is : ydderabbus



UNIT – III


FUNCTIONS:




User‐Defined Functions

Definition: A function is a block of code/group of statements/self contained block of statements/
basic building blocks in a program that performs a particular task. It is also known
as procedure or subroutine or module, in other programming languages.

To perform any task, we can create function. A function can be called many times. It
provides modularity and code reusability.

C PROGRAMMING Page 132

, Advantage of functions

1) Code Reusability

By creating functions in C, you can call it many times. So we don't need to write the same code
again and again.

2) Code optimization

It makes the code optimized we don't need to write much code.

3) Easily to debug the program.


Example: Suppose, you have to check 3 numbers (781, 883 and 531) whether it is prime number or
not. Without using function, you need to write the prime number logic 3 times. So, there is repetition of
code.

But if you use functions, you need to write the logic only once and you can reuse it several times.



Types of Functions

There are two types of functions in C programming:

1. Library Functions: are the functions which are declared in the C header files such as
scanf(), printf(), gets(), puts(), ceil(), floor() etc. You just need to include appropriate
header files to use these functions. These are already declared and defined in C
libraries. oints to be Remembered

System defined functions are declared in header files

System defined functions are implemented in .dll files. (DLL stands for Dynamic Link
Library).

To use system defined functions the respective header file must be included.

2. User-defined functions: are the functions which are created by the C programmer, so
that he/she can use it many times. It reduces complexity of a big program and optimizes
the code. Depending upon the complexity and requirement of the program, you can create
as many user-defined functions as you want.




C PROGRAMMING Page 133
€19,37
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
akhilagouri

Maak kennis met de verkoper

Seller avatar
akhilagouri A Level Notes
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
0
Lid sinds
2 jaar
Aantal volgers
0
Documenten
107
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen