Pair of Array Elements Generate Required SUM | Logical Programming in C | Naresh IT

preview_player
Показать описание
Pair of Array Elements Generate Required SUM | Logical Programming in C | Naresh IT

Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.

💡 Visit Our Websites

--------------------------

💡 About NareshIT:

"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations

--------------------------

💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.

--------------------------

💡 Please write back to us at

--------------------------

💡 Check The Below Links

Рекомендации по теме
Комментарии
Автор

Sir thousands of thanks.... I had almost waste 2/3 hours to find a good video where i can get clear concept and in your video you have provide it...thanks sir..love from Bangladesh

swacharahman
Автор

I m big fan sir
Your teaching mind blowing ..kuch bhe samaj nahi aata to main aap ki video dhek leta hu aur mere pure dout clear ho jate hai

learningislife
Автор

Thanks a lot sir
Your teaching style is brilliant

himanshupathak
Автор

If
sum = 10
n = 8
input data or array elements are : {3, 3, 3, 3, 3, 3, 3, 7}
Then
output will be:
(3, 7)
(3, 7)
(3, 7)
(3, 7)
(3, 7)
(3, 7)
(3, 7)
Here, 6 times same pair repeats.

khandkerassikuzzaman
Автор

thank you very much sir for this video

saddamahmad
Автор

Thank u sir. Sir please make sorting cocepts(different sorting technique) videos.It will be very helpful for us.

aniruddhapaul
Автор

Sir required sum=10 to add 7+1+2 is also 10 how to find it sir

MUKESHJCSE_
Автор

Sir how many loops required for if our required sum is obtain by adding 4 elements of array....

swapnalipatil
Автор

hello sir, im following yours lectures only to learn programming.but i want to know how to print sum of adjacent numbers in c.could u plz help me to solve that type of programs and i want to know the logic

muppinalakshmansaia
Автор

Sir how I find coprime number to arrays
Two or more number

biswajitghosh
Автор

Why we use the temporary value in programming

KAGANASHIVAJYOTHI-kf
Автор

And then interviewer will ask to optimise it coz interviewers hate O(N^2) complexity, and if you can't tell that you will be rejected, we have to use hash map over here

satvikkhare
Автор

Your teaching mind blowing.
sir this program is correct or not.


pair of array elements generate required diffrence program


#include <iostream>

using namespace std;

int isprime(int val)
{
if(val>=2)
{
for(int i=2;i<val;i++)
{
if(val%i==0)
return 0;
}
return 1;
}
else
return 0;
}

int main()
{
int n;

cout<<"entr size of array";
cin>>n;
int a[n];
cout<<"enter "<<n<<" number"<<endl;
for(int d=0;d<n;d++)
{

cin>>a[d];
} //int a[5]={1, 5, 3, 4, 2};
// int a[n];
//int diff=3;
//int diff1=2;
int count=0;
int temp;
if(n<=50)
{
cout<<"pairs are follows :"<<endl;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{

if(a[j]!=a[i] && a[j]<a[i] )
{
if(isprime(a[i]-a[j])==1)
{
count++;
cout << "("<<a[i]<<"-"<<a[j]<<")" << endl;
}


}

}
}
}
return 0;
}

kirantak