Header Ads Widget

how to scan the value of a variable by using pointer

 Here in this post we will write a program in which we will scan the value of a variable by using pointer . So first we have to know that what is pointer . Pointer is a variable which store the address of  another variable . So here we will take input by using pointer.

Code:-

#include <stdio.h>
int main()
{
int i;
int *pi = &i;
printf("Enter a value\n");
scanf("%d", pi);
printf("you enter %d \n", i);
return 0;
}

Output:-

Enter a value 50
you enter 50



keywords:-  

,write a program to scan and print a single integer data using pointer variable,

,how to scan a string pointer in c,

,write a program using pointers to insert a value in an array,

,write a program in c to store n elements in an array and print the elements using pointer,

,scanf pointer array,

,traverse an array using pointers,

,one dimensional array using pointers in c,

,write a program to check the array elements are odd or even using pointer and array,

,how to scan a string pointer in c,

,scanf pointer array,

,traverse an array using pointers,

,write a program to check the array elements are odd or even using pointer and array,

,write a program to scan and print a single integer data using pointer variable,

,write a program using pointers to insert a value in an array,

Recommended Post:

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-

Post a Comment

0 Comments