- 001. Technical interview questions: Print message without using semicolon
Watch all videos like this Method 1
#include<stdio.h> int main() { if(printf("KodeGod\n")) { } }
Method 2
#include<stdio.h> int main() { while(!printf("KodeGod\n")) { } }
Method 3
#include<stdio.h> int main() { for(;!printf("KodeGod\n");) { } }
- 002. Technical interview question: Print your name 5 times without a loop
Watch all videos like this #include<stdio.h> void printstring(char* name, int count) { printf("%d : %s\n",count+1,name); count+=1; if(count<=5) printstring(name, count); } int main() { char name; printf("\n Enter you name :"); scanf("%s", name); printstring(name,1); return 0; }
- 003. Technical interview question: Check number is even or odd without using arithmetic or relational operator
Watch all videos like this #include<stdio.h> int main() { int number; printf("Please input an integer number: "); scanf("%d", &number); //check 0th bit of number is 1 or 0 (number & 0x01) ? printf("%d is an ODD Number.", number) : printf("%d is an EVEN Number.", number) ; printf("\n"); return 0; }
- 004. Technical interview question: Swap two numbers without using a third variable
Watch all videos like this a = a + b; b = a - b; a = a - b; or a = a + b - (b=a);
- 005. Technical interview question: Give the output of the following code
Watch all videos like this void main() { printf("%s","kode" "god" ".com"); }
- 006. Technical interview question: Give the output of the following code
Watch all videos like this #include<string.h> void main() { clrscr(); printf("%d%d",sizeof("kodegod"),strlen("kodegod")); getch(); }
- 007. Technical interview question: Give the output of the following code
Watch all videos like this void main() { if(printf("KodeGod")) printf("Awesome"); else printf("Amazing"); }
- 008. Technical interview question: Give the output of the following code
Watch all videos like this void main() { while(1) { printf("kodegod.com"); } }
- 009. Technical interview question: Give the output of the following code
Watch all videos like this void main() { while(a=0) { printf("kodegod.com"); } }
- 010. Technical interview question: Give the output of the following code
Watch all videos like this void main() { while(a='0') { printf("kodegod.com"); } }
- 011. Technical interview question: Give the output of the following code snippet
Watch all videos like this int main() { int number = 147; //Any number. int res; if(number) res = number % 9 == 0 ? 9 : number % 9 ; else res = 0; printf("%d", res); getch(); }
- 012. Technical interview question: Check two numbers are equal without using arithmetic or relational operators
Watch all videos like this int main() { int x = 10; int y = 10; if (!(x ^ y)) printf(" x is equal to y "); else printf(" x is not equal to y "); return 0; }
- 013. Technical interview question: Give the output of this code
Watch all videos like this int main() { int i; for(i=0;i<5;i++) { int i = 10; printf("%d", i); } return (0); }
- 014. Technical interview question: Check number is even or odd without using arithmetic or relational operator in detail
Watch all videos like this int main() { int number; printf("Please input an integer number: "); scanf("%d", &number); (number & 0x01) ? printf("%d is an EVEN Number.", number) : printf("%d is an ODD Number.", number) ; printf("\n"); return 0; }
- 015. Technical interview question: Give the output of the following code
Watch all videos like this int main() { int i=2,j=2; while(i+1? --i : j++) printf("%d", i); return 0; }
- 016. Technical interview question: Give the output of the following code
Watch all videos like this int main() { int a=2,b=7,c=10; c=a==b; printf("%d", c) return 0; }
- 017. Technical interview question: Give the output of the following code
Watch all videos like this #include<stdio.h> int main() { printf("%d %d %d", sizeof(3.14), sizeof(3.14f), sizeof(3.14L)); return 0; }
- 018. Technical interview question: Give the output of the following code
Watch all videos like this main() { float me = 1.1; double you = 1.1; if(me==you) printf("Values are equal"); else printf("Values are NOT equal"); }
- 019. Technical interview question: Give the output of the following code
Watch all videos like this int main() { static int var = 5; printf("%d",var--); if(var) main(); }
- 020. Technical interview question: Convert time in seconds to hours
Watch all videos like this int main() { long sec, hr, min, t; // Declaration of variables printf("\n Enter time in seconds:"); scanf("%ld", &sec); // we have used ld for long integer hr = sec/3600; t = sec%3600; min = t/60; sec = t%60; printf("\n\nTime is %ld hrs %ld mins %ld secs", hr, min, sec); }
- 021. Technical interview question: Give the output of the following code
Watch all videos like this int main() { int i = 0; int j = i+++1; printf("%d\n", j); }
- 022. Technical interview question: Give the output of the following code
Watch all videos like this int main() { int arr = {2}; printf("%d", 0); return 0; }
- 023. Technical interview question: Find the sum of digits using single statement
Watch all videos like this #include<stdio.h> int sum(int x) { int s; for( s=0 ; x>0 ; s+=x%10 , x/=10); return s; } int main () { printf("%d", sum(143)); }
- 024. Technical interview question: Give the output the following code
Watch all videos like this #include<stdio.h> main() { int a; if (a=printf("HelloWorld")+4) printf("%d", a); }
- 025. Technical interview question: Give the output the following code
Watch all videos like this #include<stdio.h> int main() { int a = 1, b = 1, c; c = a++-++b; printf("%d, %d, %d", a, b, c); }
- 026. Technical interview question: Give the output the following code
Watch all videos like this #include<stdio.h> int main() { int a = 10, b = 10; if (a = 5) b--; printf("%d, %d", a, b--); }
- 027. Technical interview question:Give the output the following code
Watch all videos like this #include<stdio.h> int main() { int i = 2; int j = ++i + i; printf("%d\n", j); }
- 028. Technical interview question: Give the output the following code
Watch all videos like this int main() { int x=011,i; for(i=0; i<x; i+=3) { printf("KodeGod.com "); continue; printf("Learn!"); } return 0; }
- 029. Technical interview question: Give the output the following code
Watch all videos like this int main() { int i, j; i=j=2,3; while(--i&&j++) printf("%d %d", i, j); return 0; }
- 030. Technical interview question: Give the output the following code
Watch all videos like this #include<stdio.h> int main() { static int i; for(++i;++i;++i) { printf("%d ",i); if(i==4) break; } return 0; }
- 031. Technical interview question: Print each elements in an array of ints
Watch all videos like this void printArray( int arr, int size ) { const int N = 10; int j; for ( j=0; j<size; j++ ) { printf("%4d ", arr ); if ( j % N == N-1 ) printf("\n"); } } int main(int argc, char *argv) { int x = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 }; printArray( x, 40 ); printf("\n"); return 0; }
- 032. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> int main() { int arr; foo(arr); return 0; } void foo(int *arr) { int i = 10, j = 2, k; arr = &i; arr = &j; *arr = 2; for (k = 0;k < 2; k++) printf("%d\n", *arr); }
- 033. Technical interview question: Give the output of following code
Watch all videos like this int main() { int a; a= (1, 2, 3); printf("%d", a); return 0; }
- 034. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> int main() { int a = 2, b = 2, c = 0, d = 2, m; m= a++ && b++ && c++ || d++; printf("%d %d %d %d %d", a, b, c, d, m); return 0; }
- 035. Technical interview question: Give the output of following code
Watch all videos like this int main() { int i = 5; int a = --i + --i; printf("%d", a); return 0; }
- 036. Technical interview question: Give the output of following code
Watch all videos like this int main() { int x = 10; while( x --> 0 ) { printf("%d ", x); } printf("\n"); }
- 037. Technical interview question: Give the output of following code
Watch all videos like this int main() { char arr1= "aptitude in c"; char arr2= "aptitude in c"; if(arr1 == arr2) printf("cheers"); return 0; }
- 038. Technical interview question: Give the output of following code
Watch all videos like this int main() { int s = {'\0', '\0'}; int x = {'\0', '\0'}; int c = s; printf("%d", c); return 0; }
- 039. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> int main() { while(!!7) printf("Hai"); return 0; }
- 040. Technical interview question: Give the output of following code
Watch all videos like this int main() { int i = 5; int a = --i - --i - --i - --i; printf("%d", a); return 0; }
- 041. Technical interview question: Give the output of following code
Watch all videos like this static struct student { int a; int b; } struct_var {2,3}; int main() { printf("%d %d", struct_var.a, struct_var.b); return 0; }
- 042. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> int main() { int a = 5; printf("%dkodegod"+2, a); return 0; }
- 043. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> int main(){ char str; printf(" %d ",printf("kodegod")); return 0; }
- 044. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> int main(){ int i=5,j; j=++i+++i+++i; printf("%d %d", i, j); return 0; }
- 045. Technical interview question: Give the output of following code
Watch all videos like this void main(){ char c=125; c=c+10; printf("%d", c); }
- 046. Technical interview question: Give the output of following code
Watch all videos like this int main() { char *str = "x"; char c = 'x'; char arr; arr = c; printf("%d %d", strlen(str), strlen(arr)); return 0; }
- 047. Technical interview question: Give the output of following code
Watch all videos like this void main() { int const k = 5; k++; printf("k is %d", k); }
- 048. Technical interview question: Give the output of following code
Watch all videos like this int main() { int a = 10, b = 5, c = 5; int d; d = a == (b + c); printf("%d", d); }
- 049. Technical interview question: Give the output of following code
Watch all videos like this int main() { int i = 0; int x = i++, y = ++i; printf("%d % d\n", x, y); return 0; }
- 050. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> void main() { int x = 97; int y = sizeof(x++); printf("X is %d", x); }
- 051. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> int main(){ int i=5,j; j = i++ + ++i + i++; printf("%d %d", i, j); return 0; }
- 052. Technical interview question: Give the output of following code
Watch all videos like this int main(void) { int a = 10, b = 20, c = 30; printf("\n %d.. %d.. %d \n", a + b + c, (b = b*2), (c = c*2)); return 0; }
- 053. Technical interview question: Give the output of following code
Watch all videos like this int main(void) { char *ptr = "Linux"; printf("\n \n",*ptr++); printf("\n \n",*ptr); return 0; }
- 054. Technical interview question: Give the output of following code
Watch all videos like this int main(){ int arr={10,20,30}; int x=0; x = ++arr; printf("%d ",x); return 0; }
- 055. Technical interview question: Give the output of following code
Watch all videos like this #include<stdio.h> int sq(int); int main(){ int a=1,x; x = sq (++a) + sq(a++) + sq(a++); printf("%d", x); return 0; } int sq(int num){ return num * num; }
- 056. Technical interview question: Give the output of following code
Watch all videos like this int main(){ float x; x=0.35==3.5/10; printf("%f", x); return 0; }
- 057. Technical interview question: Give the output of following code
Watch all videos like this int i; int fun(); int main() { while(i) { fun(); main(); } printf("Hello\n"); return 0; } int fun() { printf("Hi"); }
- 058. Technical interview question: Give the output of following code
Watch all videos like this void fun(int); int main() { int a = 3; fun(a); return 0; } void fun(int n) { if (n > 0) { fun(--n); printf("%d ", n); } }
- 059. Technical interview question: Give the output of following code
Watch all videos like this struct { int i; float ft; } x; int main() { x.i = 4; x.ft = 7.96623; printf("%d %.2f", x.i, x.ft); return 0; }
- 060. Technical interview question: Sum of two integers without using + operator
Watch all videos like this int main() { int a = 10; int b = 10; int sum = - ( -a-b ); printf("%d", sum); return 0; }