Post Type ArchivesQuizzes By Newtum

Test Quiz

Welcome to Your Quiz: Test Quiz

Name Email
1. What will be the output of the following C code?
#include <stdio.h>
int main()
{
double *ptr = (double *)100;
ptr = ptr + 2;
printf("%u", ptr);
}
2. check alphabets ?

Thank You for Submitting your response for Quiz

Test Quiz

Please click on View Result Button to see the Result.



Aptitude test C Programming For Tech Mahindra

Welcome to Your Quiz: Aptitude test C Programming For Tech Mahindra

Name Email
1. What will be the output of the following C code?
#include <stdio.h>
int main()
{
void *p;
int a[4] = {1, 2, 3, 4};
p = &a[3];
int *ptr = &a[2];
int n = (int*)p - ptr;
printf("%d\n", n);
}
2. What will be the output of the following C code?
#include <stdio.h>
int main()
{
void *p;
int a[4] = {1, 2, 3, 8};
p = &a[3];
int *ptr = &a[2];
int n = p - ptr;
printf("%d\n", n);
}
3. What will be the output of the following C code?
#include <stdio.h>
void main()
{
char *s= "hello";
char *p = s + 2;
printf("%c\t%c", *p, s[1]);
}
4. What will be the output of the following C code?
#include <stdio.h>
int main()
{
double *ptr = (double *)100;
ptr = ptr + 2;
printf("%u", ptr);
}
5. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
void *p = &a[1];
void *ptr = &a[2];
int n = 1;
n = ptr - p;
printf("%d\n", n);
}
6. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
int *p = &a[1];
int *ptr = &a[2];
ptr = ptr * 1;
printf("%d\n", *ptr);
}
7. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
int *ptr = &a[2];
float n = 1;
ptr = ptr + n;
printf("%d\n", *ptr);
}
8. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int *p = (int *)2;
int *q = (int *)3;
printf("%d", p + q);
}
9. What will be the output of the following C code?
#include <stdio.h>
void main()
{
char *s = "hello";
char *p = s * 3;
printf("%c\t%c", *p, s[1]);
}
10. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
int b[4] = {1, 2, 3, 4};
int n = &b[3] - &a[2];
printf("%d\n", n);
}

Thank You for Submitting your response for Quiz

Aptitude test C Programming For Tech Mahindra

Please click on View Result Button to see the Result.



Aptitude Test C Programming For Advanced Students​

Welcome to Your Quiz: Aptitude Test C Programming For Advanced Students​

Name Email
1. Can you use the fprintf() to display the output on the screen?
2. What is output of below program?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
    char temp[20];
    gcvt(23.45, 3, temp);
    printf("%s", temp);
    return 0;
}
3. What is output of below program?
void main()
{
const int a = 10;
printf("%d",++a);
}
4. What is output of below program?
#include <stdio.h>
int main()
{
int a = 10;
printf("%d", a);
int a = 20;
printf("%d",a);
return 0;
}
5. Find output : 
void main()

    int a = printf ("newtum.com");
    printf("%d", a);
}
6. What is output of below program?
#include<stdio.h>
int main()
{
    if(printf("C programming is "))
    {   
        printf("Easy");
    }
    else
    {
        printf("Hard");
    }
    return 0;
}
7. Which of the following is executed by Preprocess?
8. Which of this is used to skip one iteration:
9. Find output : 
main()
{
     int x = 10;
{
  int x = 0;
   printf("%d",x);
}
}
10. The difference between variable declaration and variable definition is
11. In C all functions except main() can be called recursively.
12. What should be the output:
void main()
{
    int a = 10.5;
    printf("%d",a);
}
13.

Smallest element of array's index is called

14. Can we write a function that takes a variable argument list and passes the list to another function?
15. Which is not a string function?
16. What is output of below program?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
    char temp[20];
    gcvt(23.45,2, temp);
    printf("%s", temp);
    return 0;
}
17. Is it possible to run program without main() function?
18. The size of a structure can be determined by
i. size of variable name
ii. size of (struct tag)
19. What is the maximum number of dimensions an array in C may have ?
20. What will be the output of the program ?
#include<stdio.h>
#include<string.h>
int main()
{
char str1[20] = "Hello", str2[20] = " World";
printf("%s\n", strcpy(str2, strcat(str1, str2)));
return 0;
}
21. The function that calls itself for its processing is known as.
22. Array passed as an argument to a function is interpreted as
23. Which of the statements is correct about the program?
#include <stdio.h>
int main()
{
int i=10;
int *j=&i;
return 0;
}
24. Which of the following is true?
25. The library function used to find the last occurrence of a character in a string is
26. Who calls to the function main()
27. Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ?
28. Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1
29. The ________ operator is true only when both the operands are true.
30. In a class, except 18 all are above 50 years. 15 are below 50 years of age. How many people are there
31. Which of the following is true?
32. What will be the output of the program ?
#include<stdio.h>
int main()
{
int x, y, z;
x=y=z=1;
z = ++x || ++y && ++z;
printf("x=%d, y=%d, z=%d\n", x, y, z);
return 0;
}
33. How many main() function we can have in our project?
34. The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
35. What is output of below program?
#include <stdio.h>
char * f();
char a = 'a';
int main(int argc, char *argv[])
{
char *temp = f();
printf("%%", temp);
return 0;
}
char *f()

return &a;
}
36. Which of the following is TRUE about argv?
37. Which address does a pointer to an array store:
38. What is (void*)0?
39. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
40. What is output of below program?
void main()
{
int i,j,count;
count=0;
for(i=0; i<5; i++);

for(j=0;j<5;j++);
{
    count++;
}
}
printf("%d",count);
}
41. What do the following declaration signify?
char **argv
42. While calling the fprintf() function in the format string conversion specifier %s can be used to write a character string in capital letters.
43. What is output of below program?
#include <stdio.h>
int main(int argc, char *argv[]) {
char str1 [] = "newtum" ;
int a = 10;
char str2[12] ;
sprintf (str2, "%s-%d", str1, a) ;
printf ( "%s", str2 ) ; 
return 0;
}
44. Array passed as an argument to a function is interpreted as
45. What should be the output:
void main()

    int a = 10/3;
    printf("%d",a); 
}
46. In C, if you pass an array as an argument to a function, what actually gets passed?
47. How many times newtum.com is printed?
void main()
{
int a = 0;
while(a++ < 5-++a)
printf("newtum.com");
}
48. What is the result of 16>>2?
49. In the following code what is 'P' ?
typedef char *charp;
const charp P;
50. In c language, if a function return type is not explicitly defined then it defaults to what data type?
51. Which of the following cannot be checked in a switch-case statement?
52. What are the types of linkages?
53. What do the following declaration signify?

char *arr[10];

Thank You for Submitting your response for Quiz

Aptitude Test C Programming For Advanced Students​

Please click on View Result Button to see the Result.



Aptitude Test C Programming For Intermediate Students​

Welcome to Your Quiz: Aptitude Test C Programming For Intermediate Students​

Name Email
1. Can we write a function that takes a variable argument list and passes the list to another function?
2. In the following code what is 'P' ?
typedef char *charp;
const charp P;
3. Which of the statements is correct about the program?
#include <stdio.h>
int main()
{
int i=10;
int *j=&i;
return 0;
}
4. Which of the following is TRUE about argv?
5. What do the following declaration signify?
char **argv
6. In C all functions except main() can be called recursively.
7. The ________ operator is true only when both the operands are true.
8. The function that calls itself for its processing is known as.
9. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
10. What will be the output of the program ?
#include<stdio.h>
#include<string.h>
int main()
{
char str1[20] = "Hello", str2[20] = " World";
printf("%s\n", strcpy(str2, strcat(str1, str2)));
return 0;
}
11. What is the result of 16>>2?
12. In C, if you pass an array as an argument to a function, what actually gets passed?
13. What will be the output of the program ?
#include<stdio.h>
int main()
{
int x, y, z;
x=y=z=1;
z = ++x || ++y && ++z;
printf("x=%d, y=%d, z=%d\n", x, y, z);
return 0;
}
14. The library function used to find the last occurrence of a character in a string is
15. Who calls to the function main()
16. The size of a structure can be determined by
i. size of variable name
ii. size of (struct tag)
17. What are the types of linkages?
18. Can you use the fprintf() to display the output on the screen?
19. What is (void*)0?
20. Which of the following cannot be checked in a switch-case statement?

Thank You for Submitting your response for Quiz

Aptitude Test C Programming For Intermediate Students​

Please click on View Result Button to see the Result.



Aptitude Test C Programming for Students

Welcome to Your Quiz: Aptitude Test C Programming for Students

Name Email
1. Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?
2. Point out the error in the following program.
#include <stdio.h>
#include <stdlib.h>
int main()
{
static char *p = (char *)malloc(10);
return 0;
}
3. What will be the output of the program ?
#include<stdio.h>
int main()
{
enum status { pass, fail, atkt};
enum status stud1, stud2, stud3;
stud1 = pass;
stud2 = atkt;
stud3 = fail;
printf("%d, %d, %d\n", stud1, stud2, stud3);
return 0;
}
4. Which header file should be included to use functions like malloc() and calloc()?
5. What does the following declaration mean?
int (*ptr)[10];
6. A preprocessor directive is a message from programmer to the preprocessor.
7. The way the break is used to take control out of switch and continue to take control of the beginning of the switch?
8. What do the following declaration signify ?
void (*cmp)();
9. Left shifting an unsigned int or char by 1 is always equivalent to multiplying it by 2.
10. Will the expression *p = p be disallowed by the compiler?
11. A C variable name can start with a ____
12. A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?
13. Input/output function prototypes and macros are defined in which header file?
14. What will be the output of the program ?
#include <stdio.h>
char *str = "char *str = %c%s%c; main(){ printf(str, 34, str, 34);}";
int main()
{
printf(str, 34, str, 34);
return 0;
}
15. Prototype of a function means _____
16. Which one is not a reserved keyword in C Language?
17. Name the loop that executes at least once.
18. Which of the following statements are correct about the program?
#include <stdio.h>
int main()
{
unsigned int num;
int i;
scanf("%u", &num);
for(i=0; i<16; i++)
{
printf("%d", (num<<i & 1<<15)?1:0);
}
return 0;
}
It prints all even bits from num
19. In mathematics and computer programming, which is the correct order of mathematical operators
20. What will be the output of the program in 16-bit platform (under DOS)?
#include<stdio.h>
int main()
{
struct node
{
int data;
struct node *link;
};
struct node *p, *q;
p = (struct node *) malloc(sizeof(struct node));
q = (struct node *) malloc(sizeof(struct node));
printf("%d, %d\n", sizeof(p), sizeof(q));
return 0;
}

Thank You for Submitting your response for Quiz

Aptitude Test C Programming for Students

Please click on View Result Button to see the Result.



Aptitude test C Programming IBM

Welcome to Your Quiz: Aptitude test C Programming IBM

Name Email
1. In a class, except 18 all are above 50 years. 15 are below 50 years of age. How many people are there
2. Write a function to swaps the values of two integers.
3. Which of the following API is used to hide a window
4. What is the output of this C code?
#include
int main()
{
printf(“nn /n/n nn/n”);
return 0;
}
5. What will the following program do?
void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line number:9// p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line number 15//
6.

In the context of C data types, which of the following is correct?

7. In the following code segment what will be the result of the function, value of x, value of y
{
unsigned int x=-1;
Int y;
y=~0;
if(x == y)
printf(“same”);
Else
printf(“not same”);
}
8. The precedence of arithmetic operators is (from highest to lowest)
9. Can we have a pointer to a function?
10. Which of the following will initialize the new memory to 0 ?
11. Suppose that in a C program snippet, followings statements are used.
i) sizeof(int);
ii) sizeof(int*);
iii) sizeof(int**);
12. Let x be an integer which can take a value of 0 or 1. The statement if(x = =0) x = 1; else x = 0; is equivalent to which one of the following?
13. Do you find any issue with the above snippet of code?
14. The UNIX shell ....
15. What will be output if you will compile and execute the following c code?
#include
#define message “union is\
power of c”
int main()
{
printf(“%s”,message);
return 0;
}
16. What is the output in the following program
main()
{
char c=-64;
int i=-32 ;
unsigned int u =-16;
if(c>i)
{
printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");
}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2");
}
17. Output of the following program is
void main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
Break;
}
printf("%d,",i);
}
}
18. What will the statement char ch=’A’  store in variable ch?
19. In A,B,C are having some marbles with each of them.
A has given B and C the same number of marbles each of them already have.
Then, B gave C and A the same number of marbles they already have.
Then C gave A and B the same number of marbles they already have.
At the end A,B,and C have equal number of marbles.
(i) If x,y,z are the marbles initially with A,B,C respectively.
Then the number of marbles B have at the end
20. What is the output of this C code?
#include
int main()
{
int i = 5;
i = i / 3;
printf(“%d\n”, i);
return 0;
}

Thank You for Submitting your response for Quiz

Aptitude test C Programming IBM

Please click on View Result Button to see the Result.



Aptitude Test of TCS Fresher or Campus Interview

Welcome to Your Quiz: Aptitude Test C Programming of TCS Fresher or Campus Interview

Name Email
1. Which is not a string function?
2. What is a dangling pointer?
3. Neha is developing an IP telephony software in which the audio is encoded and transmitted by the sender as network packets through a communication channel. At the other end these packets are assembled and processed further.Neha  recognizes that there maybe a very large number of packets this number is unknown and which will be processed while more packets are being received .assume that the packets arrive in right order .what data structure should Neha use?
4. A program reads in 500 integers in the range [0…100]representing the scores of 500 students.it then prints the frequency of each score above 50.what would be the best way for the program to store the frequencies?
5. Which is the character array used to accept command line arguments?
6. The full set of operations allowed on a stack are
7. Predict the Output : 

float a = 0.1;
if(a==0.1)
printf(“Yes”);
else
printf(“No”)
8. Which address does a pointer to an array store:
9. Which of the following is NOT a valid storage class in C language?
10. Which of the following is true?
11. What is the task of pre-processor?
12. The inorder and preorder traversal of a binary tree are d b e a f c g and a b d e c f g, respectively. The post-order traversal of the binary tree is:
13. Comment on the below while statement
while(0 == 0)
{
}
14. Which of the following is true?
15. The difference between variable declaration and variable definition is
16. How many times the below loop will be executed?
#include <stdio.h>
int main()
{
int x, y;
for(x=5; x>=1; x--)
{
for(y=1; y<=x; y++)
printf("%d\n",y);
}
}
17. Which of the following does not require to include math.h header file?
18. Which of this is used to skip one iteration:
19. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1?
20. In c language, if a function return type is not explicitly defined then it defaults to what data type?

Thank You for Submitting your response for Quiz

Aptitude Test C Programming of TCS Fresher or Campus Interview

Please click on View Result Button to see the Result.



C Programming Quiz for Beginners Level 1

Welcome to Your Quiz: C Language Quiz for Beginners Level 1

Name Email
1. What is the maximum number of dimensions an array in C may have ?
2. What should be the output:
void main()

    int a = 10/3;
    printf("%d",a); 
}
3. What is output of below program?
#include <stdio.h>
int main()
{
int a = 10;
printf("%d", a);
int a = 20;
printf("%d",a);
return 0;
}
4.

Smallest element of array's index is called

5. Find output : 
void main()

    int a = printf ("newtum.com");
    printf("%d", a);
}
6. What is output of below program?
#include<stdio.h>
int main()
{
    if(printf("C programming is "))
    {   
        printf("Easy");
    }
    else
    {
        printf("Hard");
    }
    return 0;
}
7. Is it possible to run program without main() function?
8. What is output of below program?
void main()
{
int i,j,count;
count=0;
for(i=0; i<5; i++);

for(j=0;j<5;j++);
{
    count++;
}
}
printf("%d",count);
}
9. Array passed as an argument to a function is interpreted as
10. Find output : 
main()
{
     int x = 10;
{
  int x = 0;
   printf("%d",x);
}
}
11. What should be the output:
void main()
{
    int a = 10.5;
    printf("%d",a);
}
12. What is output of below program?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
    char temp[20];
    gcvt(23.45, 3, temp);
    printf("%s", temp);
    return 0;
}
13. How many times newtum.com is printed?
void main()
{
int a = 0;
while(a++ < 5-++a)
printf("newtum.com");
}
14. Array passed as an argument to a function is interpreted as
15. What is output of below program?
#include <stdio.h>
int main(int argc, char *argv[]) {
char str1 [] = "newtum" ;
int a = 10;
char str2[12] ;
sprintf (str2, "%s-%d", str1, a) ;
printf ( "%s", str2 ) ; 
return 0;
}
16. Which of the following is executed by Preprocess?
17. What is output of below program?
void main()
{
const int a = 10;
printf("%d",++a);
}
18. How many main() function we can have in our project?
19. What is output of below program?
#include <stdio.h>
char * f();
char a = 'a';
int main(int argc, char *argv[])
{
char *temp = f();
printf("%%", temp);
return 0;
}
char *f()

return &a;
}
20. What is output of below program?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
    char temp[20];
    gcvt(23.45,2, temp);
    printf("%s", temp);
    return 0;
}

Thank You for Submitting your response for Quiz

C Language Quiz for Beginners Level 1

Please click on View Result Button to see the Result.