Sum of Natural Numbers Program using Recursion C Program to find Sum of Natural Numbers using Recursion is discussed here in this tutorial. Algorithm Step 1 – First we declared a function sum( ) to calculate the sum of N natural numbers which accept a parameter K here K represent to the number up to […]
C programming Tutorials
C Program to find Sum of Array Elements Using Function
C Program to find Sum of Array Elements Using Function Here in this tutorial we have explained and implemented a c program to find the sum of array elements using function by passing array as function parameter. C Program to find Sum of Array Elements Using Function is given below #include <stdio.h> float calculateSum(float num[]); […]
Call by Value Program in C
Call by Value Program in C Call by Value Program in C is a method of passing the arguments to function and call the function in main( ) method. In tutorial we have discussed the concept of formal argument and actual argument. We have explained the concept of call by value method with help of […]
C Program to Reverse a Number
C Program to Reverse a Number C Program to Reverse a Number or find the reverse of a number is mostly asked in University exam. The program is given below #include <stdio.h> #include<conio.h> void main( ) { int n, reverse = 0, remainder; printf(“Enter an integer: “); scanf(“%d”, &n); while (n != 0) { remainder […]
C Program to Calculate the Power of a Number
C Program to Calculate the Power of a Number C Program to calculate the power of a number is generally asked in university exam. We can implement this program in c using predefined pow ( ) function and can also implement without using pow( ) function. Here in this tutorial we have implemented power calculation […]
Program to Check Vowel or Consonant in C
Program to Check Vowel or Consonant in C Five English alphabet letter a , e, i, o and u are known as vowels. All other alphabets are consonant. In this tutorial we will learn to implement a program in c to check whether a Character is a Vowel or Consonant using switch case. This program […]
Even Odd Program Using Ternary Operator
Even Odd Program Using Ternary Operator In C Programming ternary operator or conditional operator is an alternative of if else statement in c programming. syntax of ternary operator is given as ( condition ) ? expression 1 : expression 2 if the mentioned condition is true then expression 1 will be execute otherwise expression 2 will […]
Top 3 C Array Solved Programs
C Array Solved Programs C Array Solved Programs are discussed and explained in this tutorial. These programs are generally asked in technical interview and in university exam of C Programming. These Programs are based on One Dimensional Array in C. I hope that These c array solved programs will be beneficial for the students. Program […]
How to Access Structure Members in C ?
How to Access Structure Members in C ? Structure in C Programming is an important construct which is used to the information of different types of variable or data elements. We can access the structure members (means read and assign the value of structure member) using dot . operator in c programming. 1.Structure members are […]
Expression Evaluation in C
Expression Evaluation in C Programming In this C Programming Tutorial we will discuss about Operators, operands, operator precedence and associativity, Expression and expression evaluation in c programming examples. Generally expression solving questions are asked in GATE exam. Let’s start with operator introduction. What is an Operator ? Operator is a symbol or token in C […]
Union in C Programming
Union in C Programming Union in C Programming is an important concept that allow different data types to be stored in same location. Union in C Programming is an important topic for computer science students. Some time questions based on Union are asked in GATE(CS) and UGC NET exam. Today in this Union in C […]
Typedef in C Programming
What is Typedef in C Programming ? Typedef in C is an important keyword or reserved word. Typedef is used to create an additional name (alias) for a data type. This is important to note that typedef does not create another data type. Typedef is a keyword using which the user can give a new name […]
Conditional Statements in C Programming
Conditional Statements in C Programming Condition statements in C are used almost in every program written in the C programming language. This is a very important concept and a useful building block of programming construct. Every student should know how to use conditional statements in a C program ? The objective of this tutorial is to […]
Looping Statements in C Programming
Looping Statements in C Programming Looping statements in C are used to repeat a block of code or statements until a condition is satisfied. In C Programming there are three types of Loops For Loop While Loop Do-while Loop This tutorial covers the concepts of looping statements in c with example. Advantages of using loops have […]
C Tutorial to Learn C Programming Language
C Tutorial to Learn C Programming Language C Tutorial to learn C Programming Language is discussed in this post. C Programming Language is one of the most powerful languages to develop system software like operating systems, compilers, etc. Application software can also be developed in C Programming language. Students from every branch of engineering learn c […]
Program in C to Implement Lagrange’s Interpolation Formula
‘C’ program to implement Lagrange’s Interpolation formula. Theory and Concept – Interpolation formulae for equally Spaced Argument is important but as is well known they possess the disadvantage of requiring the values of the independent variable to be equally spaced. It is therefore desirable to have interpolation formulae with unequally space values of […]
Program to copy the contents of one string to another string using a pointer
A C program to copy the contents of one string to another using a pointer method is: #include #include #include #define length 50 void main() { char *s1,*s2,c; int i=0; clrscr(); s1=(char*)malloc(length*sizeof(char)); s2=(char*)malloc(length*sizeof(char)); printf(“enter stringn”); gets(s1); while((c=*(s1+i))!=”) { s2[i]=c; i++; } s2[i]=”; printf(“Copied string isn”); printf(“%s”,s2); getch(); }
How to display the value of an integer variable through pointer ?
Accessing the value of an integer through pointer. A pointer is a variable which contains the address in memory of another variable. We can have a pointer to any variable type. The unary or monadic operator & gives the “address of a variable”. The indirection or dereference operator * gives the “contents of an object pointed to by […]
Pointer to structure in C
How to use a pointer to structure in C Programming? When pointer to structure is incremented then the pointer points to the next block of memory. As for example struct rec { int a; char b[10], *c; }; main() { struct rec *obj; obj=(struct rec *)malloc(sizeof(struct rec)); obj->a=10; strcpy(obj->b, “XYZ”); strcpy(obj->c, “ABC”); printf (“n%dt%st%s”,obj->a, obj->b, […]
Pointer in C Hackerrank Solution
Pointer in C Hancerrank Solution In this Pointer in C Programming Tutorial at first we will learn about basic concepts of pointer after that we will see some pointer in c hackerrank solution for the practice of computer science students. Frequently asked Questions Some frequently asked questions from pointer in c programming are given below […]