Message from C, C++ discussions
December 2019
— Soryy
fgallego96 here's the code without mess... The previous was mess
#include<bits/stdc++.h>
using namespace std;
void missing_char(string str)
{
string new_str="";
int i;
int x=str.length();
for(i=0;i<x;i++)
{
if(str[i]!=str[x-1-i])
{
new_str+=str[x-1-i];
}
}
string temp=new_str+str;
cout<<"Insert "<<new_str<<" at the beginning to make it "<<temp;
}
int main()
{
string str;
cout<<"Enter the string : ";
cin>>str;
int x=str.length();
cout<<"\n"<<x<<endl;
cout<<str[x-1]<<"\n";
missing_char(str);
return 0;
}
— Guys, hello. Please help with my code
— Use std:: instead of using namespace std;
— For every cin and cout??
— #include <stdio.h>
//Compiler version gcc 6.3.0
int main()
{
int i, sum=0;
printf("Numbers between A and B, divisible by 3 : \n");
printf ("input A");
scanf "A";
printf ("input B");
scanf "B";
{
if(i%3==0)
{
printf("% 5d",i);
}
}
printf("%d \n");
}
— Yes, for everything in the STL. It's not that bad once you get used to it
— What is wrong here?
— I will practice it from now onwards
— How to write this code so that you can enter A and B so that it finds a multiple of 3 from A to B?
— Guys help plz
— Https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice
You can refer to this for the topic.