100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Notas de lectura

Computer system

Puntuación
-
Vendido
-
Páginas
30
Subido en
24-07-2023
Escrito en
2017/2018

Computer system, computer science, computer skills, computer language

Institución
Grado










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Nivel de Estudio
Editores
Tema
Curso

Información del documento

Subido en
24 de julio de 2023
Número de páginas
30
Escrito en
2017/2018
Tipo
Notas de lectura
Profesor(es)
Prof
Contiene
Todas las clases

Temas

Vista previa del contenido

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
$23.16
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
akhilagouri

Conoce al vendedor

Seller avatar
akhilagouri A Level Notes
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
0
Miembro desde
2 año
Número de seguidores
0
Documentos
107
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes