Example program for pointer to pointer in C C++

Example program for pointer to pointer in C C++

C Language के बारे में अधिक जानने के लिए देखें—Brief Introduction of C

C के विभिन्न control statements को जानने के लिए देखें— Control statements in C

Pointer और इसके कार्य करने के तरीके को आधिक जानने के लिए देखें यह पोस्ट—Pointers in C

Example program for pointer to pointer in C

#include<stdio.h>
int main()
{
    int num=5;
    int *ptr1;
    ptr1=#
    int **ptr2;
    ptr2=&ptr1;
    printf("Value of num   = %d",num);
    printf("\nAddress of num = %p",&num);
    printf("\nValue of num   = %d",*ptr1);
    printf("\nAddress of num = %p",ptr1);
    printf("\nValue of num   = %d",**ptr2);
    printf("\nAddress of num = %p",*ptr2);
    return 0;
}

Example program for pointer to pointer in C++

#include<iostream>
using namespace std;
int main()
{
    int num=5;
    int *ptr1;
    ptr1=#
    int **ptr2;
    ptr2=&ptr1;
    cout<<"Value of num   = "<<num<<endl;
    cout<<"Address of num = "<<&num<<endl;
    cout<<"Value of num   = "<<*ptr1<<endl;
    cout<<"Address of num = "<<ptr1<<endl;
    cout<<"Value of num   = "<<**ptr2<<endl;
    cout<<"Address of num = "<<*ptr2<<endl;
    return 0;
}

Output of example program for pointer to pointer in C C++

Pointer to pointer program output in C CPP

Similar pointer example programs in C C++

  1. Declaration and assignment of pointer
  2. Sum of two numbers using pointer
  3. Average of three numbers using pointer
  4. Swapping two variables using pointer
  5. Pointer Arithmetic
Share it to:

Example program for pointer in C C++

Example program for pointer in C C++

Pointer और इसके कार्य करने के तरीके को आधिक जानने के लिए देखें यह पोस्ट—Pointers in C

C Language में Pointer to Pointer क्या होता है जानने के लिए देखें— Pointer to pointer in C

C Language में उपलब्ध विभिन्न प्रकार के Pointers और उनके उपयोग को जानने के लिए देखें—Types of Pointer in C

Example program for pointer in C

#include<stdio.h>
int main()
{
    int num=5;
    int *ptr;
    ptr=#
    printf("Value of num   = %d",num);
    printf("\nAddress of num = %p",&num);
    printf("\nValue of ptr   = %p",ptr);
    printf("\nAddress of ptr = %p",&ptr);
    printf("\nValue of num   = %d",*(&num));
    printf("\nValue of num   = %d",*ptr);
    return 0;
}

Example program for pointer in C++

#include<iostream>
using namespace std;
int main()
{
    int num=5;
    int *ptr;
    ptr=#
    cout<<"Value of num   = "<<num<<endl;
    cout<<"Address of num = "<<&num<<endl;
    cout<<"Value of ptr   = "<<ptr<<endl;
    cout<<"Address of ptr = "<<&ptr<<endl;
    cout<<"Value of num   = "<<*(&num)<<endl;
    cout<<"Value of num   = "<<*ptr<<endl;
    return 0;
}

Output of Example program for pointer in C C++

Pointer program output in C CPP

Related pointer programs in C C++

  1. Pointer to pointer
  2. Sum of two numbers using pointer
  3. Average of three numbers using pointer
  4. Swapping two variables using pointer
  5. Pointer Arithmetic
Share it to:

C C++ program to convert uppercase to lowercase

C C++ program to convert uppercase to lowercase

विभिन्न प्रकार के Computer Coding Systems जैसे—BCD, ASCII, EBCDIC आदि के बारे में अधिक जानने के लिए देखें—Computer Coding Systems

Procedure Oriented Programming (POP) और Object Oriented Programming (OOP) में अंतर जानने के लिए देखें—POP vs OOP

C और C++ दोनों भाषाओं में महत्वपूर्ण अंतर क्या है जानने के लिए देखें—C vs C++

C program to convert uppercase to lowercase

#include<stdio.h>
int main()
{
    char ch;
    printf("Enter an uppercase letter: ");
    scanf("%c",&ch);
    ch=ch+32;
    printf("Lowercase = %c",ch);
    return 0;
}

C++ program to convert uppercase to lowercase

#include<iostream>
using namespace std;
int main()
{
    char ch;
    cout<<"Enter an uppercase letter: ";
    cin>>ch;
    ch=ch+32;
    cout<<"Lowercase = "<<ch;
    return 0;
}

Output of C C++ program to convert uppercase to lowercase

C C++ program to convert uppercase to lowercase

Important ASCII table programs in C C++

  1. Find ASCII values of a character
  2. Convert lowercase to uppercase
  3. Print complete ASCII table
Share it to:

C C++ program to convert lowercase to uppercase

C C++ program to convert lowercase to uppercase

C Language में उपलब्ध Operators और इनके विभिन्न प्रकारो को जानने के लिए देखें—Operators in C

विभिन्न प्रकार के Computer Coding Systems जैसे—BCD, ASCII, EBCDIC आदि के बारे में अधिक जानने के लिए देखें—Computer Coding Systems

C-Language में Operator Precedence और Associativity Rule क्या होता है जानने के लिए देखें— Precedence and Associativity in C

C program to convert lowercase to uppercase

#include<stdio.h>
int main()
{
    char ch;
    printf("Enter a lowercase letter: ");
    scanf("%c",&ch);
    ch=ch-32;
    printf("Uppercase = %c",ch);
    return 0;
}

C++ program to convert lowercase to uppercase

#include<iostream>
using namespace std;
int main()
{
    char ch;
    cout<<"Enter a lowercase letter: ";
    cin>>ch;
    ch=ch-32;
    cout<<"Uppercase = "<<ch;
    return 0;
}

Output of C C++ program to convert lowercase to uppercase

C C++ program to convert lowercase to uppercase

Similar ASCII programs in C C++

  1. Find ASCII values of a character
  2. Convert uppercase to lowercase
  3. Print complete ASCII table
Share it to:

C C++ program to find ASCII value of a character

C C++ program to find ASCII value of a character

If statement और decision making statements के बारे में अधिक जानने के लिए देखें— If statements in C

Looping और iterative statements के बारे में और अधिक जानने के लिए देखें— Looping statements in C

विभिन्न प्रकार के Computer Coding Systems जैसे—BCD, ASCII, EBCDIC आदि के बारे में अधिक जानने के लिए देखें—Computer Coding Systems

C program to find ASCII value of a character

#include<stdio.h>
int main()
{
    char ch;
    int val;
    printf("Enter a character: ");
    scanf("%c",&ch);
    val=ch;
    printf("ASCII value = %d",val);
    return 0;
}

C++ program to find ASCII value of a character

#include<iostream>
using namespace std;
int main()
{
    char ch;
    int val;
    cout<<"Enter a character: ";
    cin>>ch;
    val=ch;
    cout<<"ASCII value = "<<val;
    return 0;
}

Output of C C++ program to find ASCII value of a character

ASCII Value of a Character C C++ Program Output

Similar ASCII table programs in C C++

  1. Convert lowercase to uppercase
  2. Convert uppercase to lowercase
  3. Print complete ASCII table
Share it to: