After Shortlisted from TSC Online examination, all the shortlisted candidates can go for TCS Interview panel for Face to Face Interview in English, The TCS Interview completely based on the Online Merit list examination only. We’are trying to covering TCS Interview questions in below, these questions are newly updated from recent years.
The TCS Selection Process will be based on the Merit list and candidates have to follow the below given TCS Schedule and TCS Selection Process 2018, there are several levels are important for getting into the TCS Campus as an entry level post.
Apply for Wipro Off Campus Drive
Once above TCS Online tests completed at test centers, then candidates have to wait for the same test location for the shortlisted candidate’s announcement for next round of TCS Selection Process. Next, the TCS Interview conducted on the same day or next day or TCS Schedule day as per TCS Finalise information.
Tata Consultancy Service (TCS) interview questions asked in many interviews and most of the questions are repeated in every campus and state wise selections. We advised to candidates can follow the previous year TCS Interview questions and prepare according to them.
#include <stdio.h>
int main(int argc, char *argv[])
{
int n, first = 0, second = 1, next, c;
n = atol(argv[1]);
printf(“First %d terms of Fibonacci series are :-\n”,n);
for ( c = 0 ; c < n ; c++ )
{
if ( c <= 1 )
next = c;
else
{
next = first + second;
first = second;
second = next;
}
printf(“%d\n”,next);
}
return 0;
}
#include <stdio.h>
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
printf(“%d%d%d\n”, k, *p, **p);
}
a) 5 5 5
b) 5 5 junk
c) 5 junk junk
d) Compile time error
1) main() function should always be the first function present in a C program file
2) all the elements of aaunion share their memory location
3) A void pointer can hold athe ddress of any type and can be typcasted to any type
4) A static variable hold random junk value if it is not initialised
A) 2,3
B) 1,2
C) 1,2,3
D) 1,2,3,4
A) The value returned by the function does not change
B) all the variable declared inside the function automatically will be assigned initial value of zero
C) It should be called only within the same source code / program file.
D) None of the other choices as it is wrong to add static prefix to a function
Given series is, 1,1,2,3,4,9,8,27,16,81,32,243,….Soon
#include<stdio.h>
#include<math.h>
int three(n)
{
int x,i;
for(i=0;i<100;i++)
{
x=pow(3,i);
if(i==n)
printf(“%d”,x);
}
}
int two(n)
{
int x,i;
for(i=0;i<100;i++)
{
x=pow(2,i);
if(i==n)
printf(“%d”,x);
}
}
int main()
{
int n;
scanf(“%d”,&n);
if(n%2==0)
three(n/2);
else
two(n/2+1);
}
#include <stdio.h>
int main(int argc, char *argv[])
{
int c[10];
int i,temp,j,greatest;
j = 0;
for(i=1; i<argc; i++)
{
temp = atoi(argv[i]);
c[j] = temp;
j++;
}
greatest = c[0];
for (i = 0; i < 10; i++) {
if (c[i] > greatest) {
greatest = c[i];
}
}
printf(“Greatest of ten numbers is %d”, greatest);
return 0;
}
#include <stdio.h>
int main(int argc, char *argv[])
{
int n,i;
unsigned long long factorial = 1;
n = atol(argv[1]);
for(i=1; i<=n; ++i)
{
factorial *= i;
}
printf(“Factorial of %d = %llu”, n, factorial);
}
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int k;
char temp;
int i,j=0;
int strsize = 0;
for (i=1; i<argc; i++) {
strsize += strlen(argv[i]);
if (argc > i+1)
strsize++;
}
char *cmdstring;
cmdstring = malloc(strsize);
cmdstring[0] = ‘\0’;
for (k=1; k<argc; k++) {
strcat(cmdstring, argv[k]);
if (argc > k+1)
strcat(cmdstring, ” “);
}
i = 0;
j = strlen(cmdstring) – 1;
while (i < j) {
temp = cmdstring[i];
cmdstring[i] = cmdstring[j];
cmdstring[j] = temp;
i++;
j–;
}
printf(“\nReverse string is :%s”, cmdstring);
return(0);
}
#include <stdio.h>
int main(int argc, char *argv[])
{
double firstNumber, secondNumber, temporaryVariable;
firstNumber = atol(argv[1]);
secondNumber = atol(argv[2]);
temporaryVariable = firstNumber;
firstNumber = secondNumber;
secondNumber = temporaryVariable;
printf(“\nAfter swapping, firstNumber = %.2lf\n”, firstNumber);
printf(“After swapping, secondNumber = %.2lf”, secondNumber);
return 0;
}
// Program to print all value of
// command line argument
// once we get the value from command
// line we can use them to solve our problem.
#include <stdio.h> // this is used to print the result using printf
#include <stdlib.h> // this is used for function atoi() for converting string into int
// argc tells the number of arguments
provided+1 +1 for file.exe
// char *argv[] is used to store the command line
arguments in the pointer to char array i.e string format
int main(int argc, char *argv[])
{
// means only one argument exist that is file.exe
if (argc == 1) {
printf(“No command line argument exist Please provide them first \n”);
return 0;
} else {
int i;
// actual arguments starts from index 1 to (argc-1)
for (i = 1; i < argc; i++) {
int value = atoi(argv[i]);
// print value using stdio.h library’s printf() function
printf(“%d\n”, value);
}
return 0; } }
Output Answer: 24 and 50
Task Registration 2024: Telangana Academy for Skills and Knowledge TASK is the Government of Telangana…
TCS TechQueen Hackathon 2024: Are you a working professional woman, then here is the gift…
TCS Admit Card 2024: Are you looking for the TCS Next step admit card then…
TCS Off Campus Results 2024: The TCS Off campus drive hiring team is scheduled to…
HCL Techbee Offer Letter: The HCL Techbee offer letter has been sent to the selected…
InfyTQ 2024 Registration: The Infosys certification program is designed for the technical background candidates to…
View Comments