Please login

Prime

Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

Problem 14

8 comments on “Problem 14”


  • Sadique Gametor

    #include

    int main()
    {
    char a[100];
    scanf(“%[^\n]%*c”,a);
    int i,l=0;
    for(i=0;a[i]!=’\0′;i++)
    {
    l++;
    }

    for(i=l;i>=0;i–)
    {
    printf(“%c”,a[i]);
    }
    return 0;
    }


  • Promit

    #include
    int main()
    {
    char a[100],ch;
    int l,i;
    gets(a);
    for(l=0;a[l];l++);
    for(i=0;i<l/2;i++)
    {
    ch=a[i];
    a[i]=a[l-1-i];
    a[l-1-i]=ch;
    }
    puts(a);
    return 0;
    }


  • Shivam Garg

    public class reverse {
    public static void main(String[] args) throws IOException {
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    String inp=br.readLine();
    for(int i=inp.length()-1;i>=0;i–)
    {
    System.out.print(“”+inp.charAt(i));
    }

    }
    }


  • clash of clan

    import java.util.Scanner;
    public class revno
    {
    public static void main(String args[])
    {
    int i,j,n,sum=0,k;
    Scanner sc=new Scanner(System.in);
    System.out.println(“Enter the no”);
    n=sc.nextInt();
    while(n!=0)
    {
    k=n%10;
    sum=sum*10+k;
    n=n/10;

    //System.out.println(sum);
    }
    System.out.println(sum);
    }
    }