C Program to find LCM of two Numbers using Recursion

LCM program example in c

C Program to find LCM of two Numbers using Recursion What is LCM LCM: Least Common Multiple of two numbers is the number that is a common multiple of the both the numbers. Below is a program to find LCM of two numbers using recursion. #include<stdio.h> int find_lcm(int, int); // function prototype declaration int main() { … Read more

C Program to wish happy new year

wish happy new year

C Program to wish happy new year #include<stdio.h> #include<conio.h> #include<graphics.h> void shoot(); void shootagain(); void area(); void explode(int,int,int); void main() { int gm,gd=DETECT; initgraph(&gd,&gm,”C:\\TURBOC3\\BGI”); shoot(); getch(); closegraph(); } void shoot() { int i=0; int x=0,y=480,x1=15,y1=460; while(i<350) { area(); line(x+i,y-i,x1+i,y1-i); delay(50); i=i+10; cleardevice(); } explode(x+350,y-350,5); shootagain(); } void shootagain() { int i=0; int x=600,y=480,x1=585,y1=460; while(i<250) { … Read more

Goto Keyword in c Program

c prgram avoid goto

Goto Keyword in c Program In a difficult programming situation it seems so easy to use a goto to take the control where you want. However, almost always, there is a more elegant way of writing the same program using if, for, while and switch. These constructs are far more logical and easy to understand. … Read more

pointer example program in C

pointer c program example

pointer example program in C What would be the output of following pointer program written in c   main( ) { int a = 10, b = 20 ; swapr ( &a, &b ) ; printf ( “\na = %d b = %d”, a, b ) ; } swapr( int *x, int *y ) { … Read more

Introduction to Pointers in C

understanding c pointers

Introduction to Pointers in C Pointer Notation Consider the declaration, int i = 3 ; This declaration tells the C compiler to: Reserve space in memory to hold the integer value. Associate the name i with this memory location. Store the value 3 at this location. We may represent i’s location in memory by the … Read more

c program example function and pointer

c program example function and pointer

c program example function and pointer What would be the output of the following programs: main( ) { int i = 0 ; i++ ; if ( i <= 5 ) { printf ( “\nC adds wings to your thoughts” ) ; exit( ) ; main( ) ; } }

What wound be output of the following c program of function and pointer

c program example function pointer

What wound be output of the following c program of function and pointer What would be the output of the following programs:   main( ) { int i = 5, j = 2 ; junk ( &i, &j ) ; printf ( “\n%d %d”, i, j ) ; } junk ( int *i, int *j … Read more

c program example function prototype

c program example function prototype

c program example function prototype   What would be the output of the following programs: main( ) { float area ; int radius = 1 ; area = circle ( radius ) ; printf ( “\n%f”, area ) ; } circle ( int r )

c program example of function and value pass to function

c program example function and value pass to function 2

c program example of function and value pass to function c program example function and value pass to function 2 main( ) { int i = 45, c ; c = multiply ( i * 1000 ) ; printf ( “\n%d”, c ) ; } check ( int ch ) { if ( ch >= … Read more