Monday, 13 July 2020

Pointer and Array Relationship


Pointers and arrays have a special relationship in C Language.Name of an array is constant pointer which point first element of array and an array is represented by a variable that is associated with the address of its first storage location. A pointer is also the address of a storage location with a defined type, so name permits the use of the array [ ] index notation with both pointer variables and array variables. For example, the following two references in C language are equivalent in meaning:

Q = &a[0];                                                           trace(Q[2]);
trace(Q[2]);

Saturday, 11 July 2020

Greatest find CM:MM with structure | C Language

Q :  Define a structure Distance having two data members: cm and mm in integer. The program enters three variables and find which distance is the largest among them.


Answer 



#include<stdio.h>
#include<conio.h>
/*============================
     Girfa Student Help
     Find greatest cm:mm using structure
==============================*/

Recursion



Recursion



As we know C language is a building block of functions that means anything you are doing is achieved through some kind of function call. So learning about function is very important. Recursion is a concept when a function calls by itself from its function body.






Friday, 10 July 2020

Krishnamurti Number Program | C Language

Krishnamurti Number


Q : Write a program to print all the Krishnamurti number from 1 to n. Here, n is user dependent. A             Krishnamurti number is a number whose sum of factorial of individual digits equals the number.         For example, 145 = 1! + 4! + 5! = 1 + 24+ 120 = 145.

Answer :


#include<stdio.h>
#include<conio.h>
/*============================
     Girfa Student Help
     Krishnamurti number
==============================*/
int fact(int);
void main()
{