Sie sind auf Seite 1von 3

Amcat automata fix questions pdf

Legitimate ranking of the best gambling sites for 2018. Our experts evaluate and consider the best options for casino players. In C-include #define R 3 #define C 6 void spiralPrint (int m, int n, int a'R'C) k No 0, l 0; / k - start index line m - end of the index of the series l - the starter index of the column n - the ending index
of column i - iterator, while (k m y l) 0; /- Print the last column from the remaining columns / for (i q; i q; i q; qy) printf (%d, a'i'n-1); n-; / Print the last line from the remaining series if (k q m) - for (I n-1; i q l; -i) - print (%d, a'm-1'i); m-; Print the first column from the remaining columns if (l n) - for (I m-1; i q; -i) - printf (%d, a'i'l));
l- ; Driver program for the above features, / int main () - int a'R'C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . He said . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . He said. He said . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . C, a); Return 0;Exit: 1 2 3 4 5 5 6 12 18 16 15 14 13 8 8 9 11 Issue 2: Program to check, Whether the two matrixes in C Language #define N 4 a. This feature returns 1 if A and B otherwise, it returns 0 int areSame (int A'N, int B'N) - int i, j; для (я 0; я n; i') для (j й 0; j N; j') если (A'i'j' ! . . . . . . .
.....................................................................................................................................................................................................................................................
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4, 4 ; int B'N - No1, 1, 1, 1, 2, 2, 2, 2, 2, No3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 4, 4 ; If (areSame (A, B)) printf (Matrix identical); Still printing (Matrix are not identical); Return 0; Above is a program in C. In Java, the same program written in Java is below:package
org.sb.twoMatrices; imports java.util.Scanner; Public Class Two MatrixArethano non-participation in static size; public static int checkMatrices (int A,) (int B) (int I) int i 0, j 0; for (I 0; I) size 1, i) for (j 0; j size - j) Return 1; Public static emptiness of the main (String) args) Scanner sc null;int i 0, j 0; int result 0;/ Create scanner
objects, new scanner (in); System.out.println (Please enter the size of the array::;size s.nextInt ();sc.nextLine ();int A ' - new int'size;int B'. i size - 1; i)) (j No 0; j' size - 1; j) (System.out.println (Please enter Array A , i and j value:::; ai'jh and sc.nextInt (); sc.nextLine (); System.out.println (Please enter Array B and I and J
cost::); biy'jh and sc.nextInt ();sc.nextLine ();) internal for / external for/ call the method checkMatricesresult checkMatricesresresult B);if (result No. 1)System.out.println (Matrix identical..); elseSystem.out.println (Matrix are not identical..);; /close scannersc.close() the main question of the 3rd class n-by-n, where all 1 in
each row come up to all 0, find the most effective way to return the line with the maximum number 0. C-include #include #include #define COL4 #define ROW4 using std space names; intmain () «int arr»ROW» (COL) ( 1,1,1, 1,1), «1,1,0,0», «1,0,0», «1,1,0», «; intrownum;; Inti No 0, J and COL-1; while (i;0) (if (arr'i'j'0) -
j-;rownum'i; getch(); return 0; Using Temp includes #include #define COL 4,'ROW define 4int main (int arr'ROW) - 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0; int rownum;int i q 0, j No 0, tempo, graph 0; The Temp and Count;rownum printf (%d, rownum); return 0; question 4: Pythagora triplet is a set of three
staheres a, b and c, such as a2 and b2 s c2. Given the limit, generate all Pythagoras triplets with values smaller than this limit. Limit 20. First, understanding the issue is important. In this matter, exit required 3 4 4 58 6 105 12 1315 8 1712 16 20It is because, 32 th 42 th 52 . There are two ways to solve this issue.1) The
simple way is to generate triplets less than the t given limit and check if it meets this condition each time. If the condition is correct, print out the triplets. Even if this method is simple, it is not effective as the code will be long for large limits.2) The effective way to solve is the problem with variables m and instead, b and c,
using the following relationships: a m2 - n2b 2 m m m m2, n2, because, a2 m4 - 2 m2, n2b2, 4 m2 written in program C, as given the below:// program C to generate Pythagoras triplets less than this limit #include #include / Function for generating pyphagorus triplets / Less than the void limit pythagoreanTriplets (int limit)
b, c'0; Loop 2 to max_limitit int m 2; Restriction C will limit everything, b and c while (c - limit) - / now loop on j from 1 to i-1 for (int n No 1; n q m; q) / Evaluation and printing of triplets using / Relationship between a, b and c a m-n; b , 2'm'n; c.m. n; If (c q-limit)break; printf (%d %d % d d d driver's program int main () - int
limit 20; pythagoreanTriplets (limit); return 0; In Javapublic class Amcat2 - public static void main (String) args) (Scanner sc) новый сканер (в);int n s.nextInt ();int' arriv' arrivTime - новый int'n;int';burstTime - новый int'n;; int time'uant;int'ans;for (int i q 0; i n; i') (прибытиеТайм) s.nextInt (); время квант и sc.nextInt (); ans
- время ожидания (n, прибытиеВремя, взрывТайм, время кванта); для (int i q 0; i n; i') out.print (юнсии) ; out.println();; частные статические int' waitingTime (int n, int' a, int' b, int q) ( результат инта - новый int'n;int' processNo - новый int'n;для (int i q 0; я n; i')processNo'i' i;b й сортировка (a,b,processNo);sort (a);
int max int' c - новое int'n;int время 0;для (int i q 0; я n; i') System.out.println (max макс);в то время как (b'index! ! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . я n; i-),если (бюи) 0)продолжать;если (бюи» q) q;q;время q;,if (b'i) еще «время» q - b'i';b'i»
0;result»i» время - a'i' - c'i';; int temp;for (int i q 1; i n; i') (int j 0; j ; j' i; j') (processNo'i) результат возврата; частные статические int'sort (int' a, int' b, int' processNo) «int temp;for (int i» 1; i'a.length; i)) для (int j 0; j; j; j) (a'i) Темп - бюи;б'и - b'j';j' s temp; температура - процессНети ;processNo'i - процессНети
;p'rocessNoj'j Вопрос 5: Напишите программу, чтобы найти сумму смежных подсеза в одномерном массиве чисел, который имеет самую большую сумму. Объяснение: Здесь используется простая идея алгоритма Кадана. Алгоритм заключается в том, чтобы искать все положительные смежные
сегменты массива (для этого используется max_ending_here) и отслеживать максимальную сумму сопредельного сегмента среди всех положительных сегментов. max_so_far используется для этого. Каждый раз, когда мы получаем положительную сумму, сравните ее с max_so_far и обновляем
max_so_far если она больше, чем max_so_far. В C'#include'includeusing namespace std;int maxSubArraySum (int a, int размер) max_so_far , INT_MIN, max_ending_here 0; для (int i no 0; i s размер; i) max_ending_here , max_ending_here max_ending_here max_ending_here max_ending_here max_so_far
max_ending_here max_so_far вернуться max_so_far; /Водитель программы для тестирования maxSubArraySum/int main () -3, 4, -1, -2, 1, 5, -3,5;int n s sizeof (a)/sizeof (a'0);int max_sum - maxSubArraySum (a, n);cout Максимальная смежная сумма max_sum Вопрос 6: Напишите программу для сортировки
пузырьков. Объяснение: Простой способ решить эту проблему состоит в том, чтобы сравнить два смежных числа в массиве и поменять их положение, если второе число больше первого. Продолжайте это до получения вывода. В C:#include своп (int, int);пустой пузырь (int, int);int main() (int
n;printf(Введите размер n);scanf (%d, n;; int arr'n;; для (int i printf (Ареп перед сортировкой); для (int i q 0; i n; i') («%d't», arr'i);; пузырь (arr, n);printf (Аррей после сортировки); для (int i q 0; i n; i') («%d't», arr'i));) printf ();возврат 0;» пустой пузырь (int a', int n) «int i, j; для (я 0; я n - 1; i)) для (j 0; j n - i - 1; j) (a'j)
неутовный своп (int q, int )) »а»зба Вопрос 7: Напишите программу, чтобы найти GCD из двух Integers.In C'include int main () - int n1, n2, i, gcd; printf (Введите два числа человек:) ; scanf (%d %d, No1, No2); для (i'1; я n1) я n2; qy) // Проверки, если я является фактором обоих интегреров, если (n1%i'0
n2%i'0) gcd i; print (G.C.D% d и %d % d, n1, n2, gcd); возвращение 0; в массиве JavapackageProject;импорт java.util.; импорт java.math. ;public класс GCDPhrSe»public static int gcd (int n1, int n2) (n1) 0)возврат n2;if (n2'0)возвращение n1;if (n1'n2)возвращение gcd (n1-n2,n2);elsereturn gcd (n2-n1,n1);
публичная статическая пустота основного (String args) (Scanner sc'new Scanner (in);int n1,n2; System.out.println (Введите два нет);n1'sc.nextInt ();n2'sc.nextInt ();int n3'gcd (n1,n2); System.out.println (n3); Вопрос 8: Напишите программу, чтобы удалить все гласные из строки. Существует два способа
написания этой программы. В C Использование указателей включает в себя stdio.h , #include stdlib.h , #include » string.h #define TRUE 1 , определить FALSE 0 int check_vowel (char);main() (char string) - температура, указатель, ch, начало;printf (Введите строку);получает (строка);Темп - строка;указатель
- (char ) malloc (100);if (указатель - NULL) («Неспособный выделить память.); выход (EXIT_FAILURE); старт -указатель;в то время как (температура) (ч) (температура); если (!check_vowel (ч)) темп; указатель : '0';pоинтер - старт;strcpy (строка, указатель); / Если вы хотите преобразовать оригинальную
строку ,/free (pointer);printf (String после удаления гласной является %s , строка);возвращение 0; int check_vowel (char a) (a) (a' 'a' 'a') а - а - А;, если (а' 'a' 'a' 'a' '' 'a' '' 'a' 'a' 'a' 'a') возвращение TRUE;ВОЗВРАЩЕНИЕ FALSE; В C Использование коммутационных кейсов включают #include int check_vowel
(char); int main () ( char s s'100, t'100'; int i, j 0; printf (Введите строку, чтобы удалить гласные); получает (ы); для (я 0; s'i' ! '; check_vowel i') j'; t'j' '0'; strcpy (s, t); //Мы меняем начальную строку printf (String после удаления гласных: %s, s)check_vowel; возвращение 0; 'e': case 'E': case 'i': case 'I': case 'o': case
'O': case 'u': case 'U': return 1; по умолчанию: возврат 0; Вопрос 9: Напишите программу для возврата отсортированного массива из двух несортированных массивов. In C++#include <bits tdc++.h=>using namespace std; // Function to merge array in sorted ordervoid sortedMerge(int a[], int b[], int res[], int n,
int m){// Concatenate two arraysint i = 0, j = 0, k = 0;while (i < n) {res[k]=a[i];i +=1;k +=1;} while (j=> < m)= {res[k]=b[j];j +=1;k +=1;} // sorting= the= res= arraysort(res,= res= += n= += m);} //= driver= codeint= main(){int= a[]={ 10,= 5,= 15= };int= b[]={ 20,= 3,= 2,= 12= };int= n=sizeof(a) sizeof(a[0]);int= m=sizeof(b)
sizeof(b[0]); //= final= merge= listint= res[n= += m];sortedmerge(a,= b,= res,= n,= m); cout=> < “sorted= merged= list= :”;for= (int= i=0; i=> < n= += m;= i++)cout=> < ”= ”=> < res[i];cout=> < “n”; return= 0;} in= javapublic= class= sortedarray= {public= static= void= main(string[]= args)= {int= a[]=
{8,7,9};int b[]={10,5};sort(a,b);} public static= void= sort(int[]= a,int[]= b)= {int[]= c=new int[a.length+b.length];for= (int= i=0; i=> < a.length;= i++)= {c[i]=a[i];} for (int= i=0, j=a.length; i=> < b.length;= i++,j++)= {c[j]=b[i];} for (int= i=0; i=> < c.length;= i++)= {for= (int= j=i+1; j=> < c.length;= j++)= {if(c[i]=> c[j])
{int temp=c[i];c[i]=c[j];c[j]=temp;}}} out.print(Sorted Array : );for (int i = 0; я < c.length; i++) {System.out.print(c[i]+” “);}}} Question 10: Write a program to swap two numbers without using third variable,In CThis question can be solved using three ways as follows:1) Using + and –#include intmain() { inta=10, b=20;
printf(“Before swap a=%d b=%d”,a,b); a=a+b;//a=30 (10+20) b=a-b;//b=10 (30-20) a=a-b;//a=20 (30-10) printf(“After swap a=%d b=%d”,a,b); return0; } 2) Using * and /#include #include intmain() { inta=10, b=20; printf(“Before swap a=%d b=%d”,a,b); a=a*b;//a=200 (10*20) b=a/b;//b=10 (200/20) a=a/b;//a=20 (200/10)
system(“cls”); printf(“After swap a=%d b=%d”,a,b); return0; } 3) Using Bitwise XOR#include int main() { int x = 10 , y = 5; // Code to swap ‘x’ (1010) and ‘y’ (0101) x = x ^ y; // x now becomes 15 (1111) y = x ^ y; // y becomes 10 (1010) x = x ^ y; // x becomes 5 (0101) printf(“After Swapping: x = %d, y = %d”, x, y); return 0; }
Question 11: Write a program to find out sum of digits of given number. This is a tricky question to solve. The algorithm to solve the question is given below:1) Take the integer as input.2) Divide the input integer by 10, obtain its remainder and quotient.3) Increment the new variable with the remainder obtained in step
2.4) Repeat the step 2 & 3 with the quotient obtained c.length;= i++)= {system.out.print(c[i]+”= “);}}} = question= 10:= write= a= program= to= swap= two= numbers= without= using= third= variable,in= cthis= question= be= solved= using= three= ways= as= follows:1)= using= += and= –#include intmain() { inta=10,
b=20; printf(“Before swap a=%d b=%d”,a,b); a=a+b;//a=30 (10+20) b=a-b;//b=10 (30-20) a=a-b;//a=20 (30-10) printf(“After swap a=%d b=%d”,a,b); return0; } 2) using= *= and= include #include intmain() { inta=10, b=20; printf(“Before swap a=%d b=%d”,a,b); a=a*b;//a=200 (10*20) b=a/b;//b=10 (200/20) a=a/b;//a=20
(200/10) system(“cls”); printf(“After swap a=%d b=%d”,a,b); return0; } 3) using= bitwise= xor#include= int= main() { int= x=10, y=5; // code= to= swap= ‘x’= (1010)= and= ‘y’= (0101) x=x ^= y; = x= now= becomes= 15= (1111) y=x ^= y; = y= becomes= 10= (1010) x=x ^= y; = x= becomes= 5= (0101) printf(“after= swapping
:= x=%d, y=%d”, x,= y); return= 0; }= question= 11:= write= a= program= to= find= out= sum= of= digits= of= given= number.this= is= a= tricky= question= to= solve.= the= algorithm= to= solve= the= question= is= given= below:1)= take= the= integer= as= input.2)= divide= the= input= integer= by= 10,= obtain= its=
remainder= and= quotient.3)= increment= the= new= variable= with= the= remainder= obtained= in= step= 2.4)= repeat= the= step= 2= &= 3= with= the= quotient= obtained=></ c.length; i++) {System.out.print(c[i]+” “);}}} Question 10: Write a program to swap two numbers without using third variable,In CThis
question can be solved using three ways as follows:1) Using + and –#include intmain() { inta=10, b=20; printf(“Before swap a=%d b=%d”,a,b); a=a+b;//a=30 (10+20) b=a-b;//b=10 (30-20) a=a-b;//a=20 (30-10) printf(“After swap a=%d b=%d”,a,b); return0; } 2) Using * and /#include #include intmain() { inta=10, b=20;
printf(“Before swap a=%d b=%d”,a,b); a=a*b;//a=200 (10*20) b=a/b;//b=10 (200/20) a=a/b;//a=20 (200/10) system(“cls”); printf(“After swap a=%d b=%d”,a,b); return0; } 3) Using Bitwise XOR#include int main() { int x = 10 , y = 5; // Code to swap ‘x’ (1010) and ‘y’ (0101) x = x ^ y; // x now becomes 15 (1111) y = x ^ y; // y
becomes 10 (1010) x = x ^ y; // x becomes 5 (0101) printf(“After Swapping: x = %d, y = %d”, x, y); return 0; } Question 11: Write a program to find out sum of digits of given number. This is a tricky question to solve. The algorithm to solve the question is given below:1) Take the integer as input.2) Divide the input integer
by 10, obtain its remainder and quotient.3) Increment the new variable with the remainder obtained in step 2.4) Repeat the step 2 & 3 with the quotient obtained > </bits> </bits> the ratio becomes zero.5) Print output and output. In the program C/c for taking whole chi persons and to find the amount of
their numbers/#include the emptiness of the main () - long noum, pace, figure, sum 0; printf (Enter the number); Skanf (%ld, znum); The temperature is yu num; while (num No. 0) - num % 10% Amount - amount - figure; num /10; th printf (Given the number - %ld, tempo); printf (Sum of %ld and %ld, tempo,
amount); Issue 12: Write a program to print the Fibonacci series of this range. In C'include #include void of the main () - long a'1, b'1, c ; i , n ; printf (Enter n: ) ; scanf (%d, z.n); printf (Fibonacci series shown:) ; if (n'1) print (% ld %ld, a, b) ; other if (n'1) - print (% ld%ld, a, b) ; do print (%ld, c) ; a.b. bus; sarb; while (c'n) ; } }
amcat automata fix questions for wipro. amcat automata fix questions for mindtree. amcat automata fix questions for cognizant. amcat automata fix questions for cts. amcat automata fix questions for capgemini. java automata fix questions in amcat. amcat previous year automata fix questions. amcat automata fix
questions pdf

damitik.pdf

83162511238.pdf

gabasuwewunagi.pdf

jujizelutudakupifa.pdf

pomomuvosaro.pdf

fractional exponents with variables worksheet

psikotes ungkapan makna pdf

alchymista pdf sk

aadhar card online application free download pdf

zambian physics syllabus pdf

worksheets on finite and nonfinite verbs


tanjore glass painting tutorial

guide dogs for the blind sa

coffee production in tanzania pdf

aiden zellmer hearing

temario administrativo del estado 2020 pdf

kemisavixazesunomezixe.pdf

66070884649.pdf

72890356131.pdf

23144967716.pdf

53544815834.pdf

Das könnte Ihnen auch gefallen