Bhanu Priya has Published 1581 Articles

Write a C program to convert uppercase to lowercase letters without using string convert function

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:57:45

7K+ Views

Before going to know about how to convert upper case to lower case letters without string convert function.Let us have a look on program to convert upper to lower using convert function, then you will get a clarity on what we are doing in the program −Example#include #include ... Read More

Write a C program demonstrating strlen library function

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:56:47

206 Views

The strlen () functionIt returns the number of characters in a string.Syntaxint strlen (string name)In this program, with the help of gets function reading the name at run time and trying to print the length of that name using strlen() function, this function returns an integer value and try to ... Read More

Converting string to number and number to string using C language

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:55:43

935 Views

ProblemWhat do you mean by String to number and number to string conversion in C programming language?SolutionThere are two functions available for conversion. They are −sscanf() − convert string to numbersprintf () − used for converting number to stringString to number conversionWe can convert string to number using the sscanf() ... Read More

How to create a pointer for strings using C language?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:47:32

1K+ Views

Arrays of pointers (to strings)Array of pointers is an array whose elements are pointers to the base address of the string.It is declared and initialized as follows −char *a[3 ] = {"one", "two", "three"}; //Here, a[0] is a ptr to the base add of the string "one" //a[1] is a ... Read More

Write a program to understand the concept of pointers in C language?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:42:01

342 Views

Pointer is a variable which stores the address of other variable.Features of PointersFollowing are the features of pointers −Saves the memory spaceExecution time is faster because of direct access to memory location.The memory is accessed efficiently with the pointer i.e. dynamically memory is allocated and deallocated.Pointers are used with data ... Read More

Working with two-dimensional array at runtime in C programming

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:40:45

1K+ Views

ProblemWrite a C program to calculate sum and product of all elements in two-dimensional array using run time compilation.SolutionRuntime compilation or initialization is also called as dynamic allocation. Allocation of memory at the time of execution (run time) is known as dynamic memory allocation.The functions calloc() and malloc() support allocating ... Read More

What do you mean by Dynamic memory allocation in C programming?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:39:33

12K+ Views

Dynamic Memory AllocationAllocation of memory at the time of execution (run time) is known as dynamic memory allocation.The functions calloc() and malloc() support allocating of dynamic memory.Dynamic allocation of memory space is done by using these functions when value is returned by functions and assigned to pointer variables.In this case, ... Read More

What do you mean by static memory allocation in C programming?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:33:58

2K+ Views

Memory can be allocated in the following two ways −Static Memory AllocationStatic variable defines in one block of allocated space, of a fixed size. Once it is allocated, it can never be freed.Memory is allocated for the declared variable in the program.The address can be obtained by using ‘&’ operator ... Read More

How to assign a pointer to function using C program?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:32:14

646 Views

Pointer to functionIt holds the base address of function definition in memory.Declarationdatatype (*pointername) ();The name of the function itself specifies the base address of the function. So, initialization is done using function name.For example, int (*p) (); p = display; //display () is a function that is defined.Example 1We shall ... Read More

Finding even and odd numbers in a set of elements dynamically using C language

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 08:31:18

1K+ Views

ProblemTo compute sum of even numbers and odd numbers in a set of elements using dynamic memory allocation functions.SolutionIn this program, we are trying to find even and odd numbers in a set of numbers.The logic used to find even numbers in a set elements is given below −for(i=0;iRead More

Advertisements