+ 1
How can i write this C program in python with exactly matching lines? please help me.
#include<stdio.h> #include<string.h> int main() { int len,i; char alc[100]; scanf("%s",&alc); len=strlen(alc); for(i=len-1;i>=0;i--) { printf("%c",alc[i]); } return 0; }
8 Réponses
+ 4
The new method is good thnx
+ 2
Abhay thnx for help but it is producing a syntax error
+ 1
I think it's accepting a string and printing letters in reverse order
In python that would be
a=input()
String_length=len(a)
for i in range((String_length-1),-1,-1):
print(a[i],end="")
+ 1
Working fine
Input:
hello
Output:
olleh
+ 1
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 yup I know but he said the exactly or somewhat like c program
0
Thnx i had missed something now its fine :)