- 1
#include <stdio.h> #include <string.h> int main() {   string alien;   scanf("%s",alien); strrev(alien); printf("%s",alie
What is the error in this code
11 Answers
+ 5
Your program have errors u cannot take input like this and string is not any data data type u write string alien its wrong . You have not used printf and scanf properly in program see this example
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string str = "Hello world"; Â
    // Reverse str[begin..end]
    reverse(str.begin(), str.end());
    cout << str;
    return 0;
}
+ 4
You have just started the C course!
There's nothing called string in C
Make a char array
+ 4
if u want to take input from user u can use gets() function
+ 4
You forget & address in scanf
+ 2
You don't have string data types in C..... You can write
char* alien;
printf("%s", &alien); đ
0
the last line of your code doesn't have a bracket.
the alien string on the second printf isn't complete, I mean the complier didn't found 'alie' variable. more errors could be there since I don't use C.
0
#include <stdio.h>
#include <string.h>
int main()
{
  string alien;
  scanf("%s",alien);
strrev(alien);
printf("%s",alien);
return 0;
}
0
Still not working stray/302 error