banner image

zoho placement c programs and answers collections:

LIST OF C POGRAMS ASKED IN ZOHO PREPARATION:

This article describes about the questions asked in zoho second round c programming ,following are the c programs that are asked during the zoho placement second round c program questions..


DOWNLOAD THE FILES:

zoho 2nd round all c program collections


zoho aptitude model



SOME OF THE SOLUTIONS I HAVE FOUNDED ON THE INTERNET I HAVE SHARED BELOW FOR YOUR REFERENCE:


Twice the Vowel



Problem Statement



If a vowel is found in the given string twice that vowel character of a string in the same array efficiently.



Input Format



The first line contains the number of test cases T. Next T lines contains an input string.



Output Format



Print the modified string.



Sample Input



1

Tamil



Sample Output



Taamiil



Code:




#include<stdio.h>

int check_vowel(char);



int main()

{

  char s[100];

  int i, j = 0;

    int count=0;

    int n;

    scanf("%s",s);

    n=strlen(s);



printf("%d%s",n,s);

 for(i = 0; i<n; i++)

  {

    if(check_vowel(s[i])==1)

       

    {

        for(j=n-1;j>=i;j--){

            s[j+1]=s[j];}

        i++;

    }

    n++;

      }

   



  printf("String after repeating vowels: %s\n", s);

  return 0;

}





int check_vowel(char c)

{

  switch(c) {

    case 'a':

    case 'A':

    case 'e':

    case 'E':

    case 'i':

    case 'I':

    case 'o':

    case 'O':

    case 'u':

    case 'U':

      return 1;

      break;

    default:

      return 0;

  }}





ROUND 2: SIMPLE CODING(3 hours)

1. Write a program to give the following output for the given input
Eg 1: Input: a1b10
       Output: abbbbbbbbbb
Eg: 2: Input: b3c6d15
          Output: bbbccccccddddddddddddddd
The number varies from 1 to 99.


CODING:

#include<stdio.h>
#include<string.h>
int main()
{
char a[100],t;
int i,j,x,f;
printf("Enter the string:");
scanf("%s",&a);
for(i=0;i<strlen(a);i=i+2)
{
t=a[i];
if((a[i+2]-48)>=0 && (a[i+2]-48)<=9)
{
int x;
x=((a[i+1]-48)*10)+(a[i+2]-48);
for(f=0;f<x;f++)
{
printf("%c",t);
}
i++;
}
else
{
for(j=0;j<a[i+1]-48;j++)
{
printf("%c",t);
}
}

}
return 0;
}


3.Write a program to print the following output for the given input. You can assume the string is of odd length
Eg 1: Input: 12345
       Output:
1       5
  2   4
    3
  2  4
1      5
Eg 2: Input: geeksforgeeks
         Output:
g                         s
  e                     k
    e                 e
      k             e
        s         g
          f      r
             o
          f     r
        s         g
      k             e
    e                 e
  e                      k
g                          s 


CODING:




#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

int i,j,l;

char a[100];

scanf("%s",&a);

l=strlen(a);

for(i=0;i<l;i++)

{

for(j=0;j<l;j++)

{

if(i==j)

{

printf("%c",a[i]);

}

else if(i+j==l-1 && i!=j)

{

printf("%c",a[i]);

}

else

{

printf(" ");

}

}

printf("\n");

}

getch();


}

6. Using Recursion reverse the string such as
Eg 1: Input: one two three
      Output: three two one
Eg 2: Input: I love india
      Output: india love I 

CODING:

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

char a[1000];

int i,j,count=0;

clrscr();

gets(a);

for(i=strlen(a)-1;i>=0;i--)

{

count=count+1;

if(a[i]==' '|| i==0)

{

for(j=i;j<=i+count;j++)

{

printf("%c",a[j]);

}

count=0;

}

}

getch();

}


FOR MORE PROGRAMS AND THE OUTPUTS CHECK THE LABELS AND THE RECENT POSTS!!!!!!!!!!



zoho placement c programs and answers collections: zoho placement c programs and answers collections: Reviewed by astin salvi on 10:39 AM Rating: 5

No comments:

Powered by Blogger.