Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Programming Questions
How would you find the length of each string in the following Program? main() { char *str[] = { "Frogs", "Do", "Not" , "Die" , "They" , "Croak!"}; printf ("%d%d", sizeof (str), sizeof (str[0])); }
Point out the error, if any, in the following program. #include "stdio.h" main() { unsigned char; FILE *fp; fp = fopen ("trail", "r"); while (( ch = getc (fp)) ! = EOF) printf ("%c", ch); fclose (fp); }
Point out the error, if any, in the following program. #include "stdarg.h" main() { display ( 4, 12.5, 13.5, 14.5, 44.3); } display(int num, ...) { float c; int j; va_list ptr; va_start (ptr, num); for ( j = 1; j <= num; j++) { c = va_arg ( ptr, float ); printf ("\n%f", c); } }
What would be the output of the following program? main() { char huge * near * far *ptr1; char near * far * huge *ptr2; char far * huge * near *ptr3; printf ("%d%d%d", sizeof (ptr1), sizeof (ptr2), sizeof (ptr3)); }
How would you use the function memmove()?
What will be output of following program ? #include int main() { int a = 10; void *p = &a; int *ptr = p; printf("%u",*ptr); return 0; }
What will output when you compile and run the following code? #include struct student { int roll; int cgpa; int sgpa[8]; }; void main() { struct student s = { 12,8,7,2,5,9 }; int *ptr; ptr = (int *)&s; clrscr(); printf( "%d", *(ptr+3) ); getch(); }
C program to find whether a number is palindrome or not.
Write a c program to find out sum of diagonal element of a matrix.
The output of the code below is #include void main() { int i = 0, k; if ( i == 0 ) goto label; for ( k = 0;k < 3; k++ ) { printf( "hin" ); label: k = printf( "%03d", i ); } }
Can you suggest any other way of writing the following expression such that 30 is used only once? a <= 20 ? b = 30 : c = 30 ;
What would be the output of the following program? main() { int i = -3, j =2, k =0, m ; m = ++j && ++i || ++k ; Printf ( "\n%d%d%d%d", i , j , k , m ); }
We want to round off x, a Float to an Int value. The correct way to do so would be
What would be the output of the following program? # define SQR(x) (x * x) main() { int a, b = 3; a = SQR ( b + 2 ); Printf ("\n %d ", a ); }
What is Autosys?
Two main measures for the efficiency of an algorithm are
What is math.floor(3.6)?
What is the output of this C code? #include void main() { int x = 97; char y = x; printf("%cn", y); }
Which of the following is true?
Methods declared as what cannot be overriden?
1
2
3
4
5
6