# Category: c++ programming

#### c++ program to illustrate the friend function,here we are finding mean of two numbers.

//wap in c++ to illustrate the friend function,here we are finding mean of two numbers. #include<iostream>using namespace std;class sample{ int…

Constructor constructor is a special type of function or method in which there is No return type(Even void) and constructor…

#### c++ to calculate the sum of 2 interger no. by using constructor concept

//wap to calculate the sum of 2 interger no. by using constructor concept#include<iostream>using namespace std;class sum{ int a,b,s; public: sum(int…

#### c programming for bubble sort

#include<stdio.h> void selection_sort(int arr[],int num); int main() { int arr,num,i; printf(“Enter the size of arrayn”); scanf(“%d”,&num); printf(“nEnter the elements in…

#### c programming for bubble sort

#include<stdio.h>void bubble_sort(int [],int num);int main(){int arr,num,i;printf(“n Enter the size of the arrayn”);scanf(“%d”,&num);printf(“n Enter the elements in the array one by…

#### c program to find prime factors of a number

#include<stdio.h>int prime_number(int num);int main(){ int num; printf(“n Enter a number for prime factor”); scanf(“%d”,&num); prime_number(num);}int prime_number(int num){ int i=2; while(num!=1)…

#### C program for prime or not

#include<stdio.h>int main(){ int num,flag=0; printf(“Enter a numbert”); scanf(“%d”,&num); //if the number is divisible by half of its number that is…

#### c programming for Euler’s Method

Euler’s Method Algorithm: Start Define function Get the values of x0, y0, h and xn*Here x0 and y0 are the…

#### c program for Runga-kutta method of 4th order

#include<stdio.h>#include<math.h>float f(float x,float y){float f; f=((1/(x+y)));return (f);} int main() {float x0,y0,h,xn,k,k1,k2,k3,k4;printf(“n Enter the initial value that is x0 and y0n”);scanf(“%f%f”,&x0,&y0);…