Recommended For You

Thursday, October 15, 2020

Cognizant Automata Fix Questions with Solutions

    



Automata Fix Questions


                                                    

  
      Clik To Join Telegram To Stay Updated


1. Find the Bug:

int main(void)
{
    printf("Find the " mistake " in programe");
    return 0;
}



2. Find Factorial :


int main()
{
    long int fact = 1, n, i;
    scanf("%d", &n);

    for (= 1; i <= n; i++)
    {
        fact = fact * i;
    }
    printf("%d", fact);
    return 0;
}



3. Print Pattern :

1111

222

33


void main()
{
    int i, j, n;
    scanf("%d", &n);
    for (= 1; i <= n; i++)
    {
        for (= 1; j <= n; j++)
        {
            printf("%d", i);
        }
        printf("\n");
    }
}



4. Greatest of 3 :


int main()
{
    int num1, num2, num3;
    scanf("%d %d %d", &num1, &num2, &num3);
    if (num1 > num2)
        &&(num1 > num3)
        {
            printf("%d", num1);
        }
    elseif(num2 > num3)
    {
        printf("%d", num2)
    }
    else
    {
        printf("%d", num3);
    }
    return 0;
}



5. Printing from 0 to N

int main()
{
    int n;
    scanf("%d", &n);
    unsigned int i = n;
    while (>= 0)
    {
        printf("%dn", i);
        i--;
    }
    return 0;
}



1 comment:

  1. Online Training is the future of education, and it is happening right now all around us. eLearning, mobile learning, distance education; all of these technologies are providing access to information and skills that were previously available only to a select few.

    ReplyDelete