Motionzen
☰
×
◈ Introduction
◈ WIN-IT
◈ Smartplay Technologies
◈ TATA Power
◈ Sasken Technology
◈ MREC Tech
◈ RRSTB Consultancy
◈ Methode Electronics
◈ Hyundai Mobis
◈ Dexcel Electronices
◈ Data Patterns
◈ PROTECH
◈ VVDN - I
◈ VVDN - II
◈ VVDN - III
◈ UST Global - I
◈ UST Global - II
◈ UST Global - III
◈ Other Companies - I
◈ Other Companies - II
◈ Other Companies - III
Home
About
Consulting
Training
Tutorial
Interview Questions
Contact
Interview Questions
sasken-technology - Interview Experience
Home
Company Interview Experience
◈ Introduction
◈ WIN-IT
◈ Smartplay Technologies
◈ TATA Power
◈ Sasken Technology
◈ MREC Tech
◈ RRSTB Consultancy
◈ Methode Electronics
◈ Hyundai Mobis
◈ Dexcel Electronices
◈ Data Patterns
◈ PROTECH
◈ VVDN - I
◈ VVDN - II
◈ VVDN - III
◈ UST Global - I
◈ UST Global - II
◈ UST Global - III
◈ Other Companies - I
◈ Other Companies - II
◈ Other Companies - III
Interview Questions
Sasken Technology - Interview Experience
« Prev
Next »
SASKEN Technology- Interview Questions and Answer
Find Output of the Following C Program Program 1 #define cal(x) (x*x*++x) main() { int i,j=5; i=cal(j); printf("%d..%d\n",i,j); } Program 2 main() { int i=400,j=800; printf("%d..%d"); } Program 3 main() { int x=10; int y=+x++x; printf("%d\n",y); } Program 4 void fun(int n) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } main() { int a=3; fun(a); printf("\n"); } Program 5 void test(void) { int j=10; printf("%d ",j); j++; } main() { int i; for(i=0;i<5;i++) test(); } Program 6 main() { int num; num=321; num=fu(num); printf("%d",num); } int fu(int num) { static int n=0; int r; if(num) { r=num%10; n=n*10+r; fu(num/10); return n; } else return n; } Program 7 void holy(int c); main() { int index; index=3; holy(index); } void holy(int c) { c--; printf("%d",c); if(c>0) holy(c); printf("%d",c); } Program 8 #define sq(x) x*x main() { int i; i=64/sq(4); printf("%d\n",i); } Program 9 char* f(int *i,float *j) { static char *s="function pointer"; s=s+*i+(int)*j; return s; } main() { char *str; int x=2; float y=3.01; char *(*p) (int*,float*); p=&f; str=(*p)(&x,&y); printf("%s",str); } Program 10 main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("%u %u\n",j,k); } Program 11 main() { int a[5]={1,2,3,4,5}; printf("%u\n",a);// 100 printf("%u %u \n",a+1,&a+1);// 104 120 } Program 12 main() { short a[4][3]={ {1},{2,3},{4,5,6}}; printf("%d\n",sizeof(a)); } Program 13 main() { int a[]={1,2,3,4}; int b[a[3]]={1,2}; for(int i=0;i<4;i++) printf("%d\n",++b[i]); } Program 14 main() { int a=5; int *b; b=&a; printf("%d\n",b); } Program 15 main() { int *num; num=f(45,39); printf("%d\n",num); } int *f(static int i,static int j) { } Program 15 main() { char *str="alice"; int i=0; while(*str !='\0') { i++; str++; } printf("%d\n",i); } Program 17 main() { char str[]="take care"; f(str); } void f(char *str) { printf("%s\n",str); } Program 18 main() { char **ptr; char *str="hello"; int i=0; ptr=(char**)calloc(sizeof(char**),3); if(ptr==0) exit(-1); while(ptr!=0) *(str+i++)=(str+i++); for(i=0;i<3;i++) printf("%s\n",ptr[i]); } Program 19 main() { char emp[45]; gets(emp); puts(emp); } Program 20 main() { printf(5+"life is beautiful"); } Program 21 char *f() { char *temp="local string"; return temp; } main() { puts(f()); } Program 22 #include
#define buf 100 main() { char b[buf]; while(fgets(b,buf,stdin)!=NULL) printf("%s\n",buf); } Program 23 main() { fprintf("action"); printf("%.ef",2.0); } Program 24 A Single Linked list Contains the binary values in each node. Print the corresponding Decimal value for the same #include
#include
struct st { unsigned long long int num; struct st *next; }; struct st *hptr; void add(); void print(); main() { int i,node; printf("enter the number of nodes you want to print\n"); scanf("%d",&node); for(i=0;i
num); temp->next=hptr; hptr=temp; } void print() { struct st *temp=hptr; int n,rem,j=1,sum=0; while(temp) { n=temp->num; while(n) { rem=n%10; sum=sum+rem*j; j=j*2; n=n/10; } printf("[%llu] equivalent decimal is : [%d]\n",temp->num,sum); temp=temp->next; sum=0; j=1; } } Program 25 Find the lowest path from the following 1 5 8 6 7 9 12 10 11 Following condition a) Start From A(0,0) b) Reach till A(2,2) c) Traverse in such a way that each time Take One Left and then Take One Right or Take one Right then take one left and reach till A(2,2) d) Sum the values at each index traversed and find the lowest path. #include
main() { int a[3][3]={1,5,8,6,7,9,12,10,11}; int i,j,c=0,k,sum=0; for(i=0,j=0;i<3;c++) { sum=sum+a[i][j]; printf("%d ",a[i][j]); if(c%2==0) { printf(" "); i++; } else { printf("\t"); j++; } } printf("sum=%d\n",sum); } Program 26 /* There are 3 classes, Alpha, Beta, Gama a. Alpha and Beta are predefined classes b. Gama derived from Alpha, Beta c. u and v are class members of Alpha, d. Create constructor in Gama class with parameters a and b e. Assign values of a and b to u and v f. show() function will be called from Gama Class and values will be displayed. */ #include
using namespace std; class alpha { private: int u; int v; public: int show() { cout<<"in alpha_show()...."<
#include
#include
int min(int x, int y) { return (x < y)? x: y; } // Returns minimum number of jumps to reach a[n-1] from a[0] int min_jumps(int a[], int n) { int *p =malloc(100); //p[n-1] will hold the result int i,j; if(n==0 || a[0]==0) return INT_MAX; p[0]=0; // Find the minimum number of jumps to reach a[i] // from a[0],and assign this value to p[i] for(i=1;i
« Prev
Next »
Helpful Links
Sateeshkg Home
Interview Questions
Corporate Training
Recommended Books
Linux Consulting
Apply for Job Assistance
If you have any queries please email us at
info@motionzen.com