TECHNICAL QUESTIONS

Post on 05-Jan-2016

39 views 1 download

Tags:

description

TECHNICAL QUESTIONS. #include void main() { float x = 1.66, y = 1.75; printf(“%f%f”,ceil(x), floor(y)); }. TECHNICAL QUESTIONS. #include void main() { int x = 10, y =20; if(!(!x) && x) printf(“x = %d”,x); else printf(“y = %d“,y); }. TECHNICAL QUESTIONS. - PowerPoint PPT Presentation

transcript

#include<stdio.h>void main(){

float x = 1.66, y = 1.75;printf(“%f%f”,ceil(x), floor(y));

}

#include<stdio.h>void main(){

int x = 10, y =20;if(!(!x) && x) printf(“x = %d”,x);else

printf(“y = %d“,y);}

#include<stdio.h>void main(){

int a = 500, b=100,c;if(!a >= 400) b = 300;c = 200;printf(“b = %d c = %d”,b,c);

}

#include<stdio.h>void main(){

int a = 10,b;a >= 5 ?b=100 :b=200;printf(“%d”,b);

}

Which of the following cannot be checked in a switch - case statement?

a.Characterb.Integerc.Float

Which of the following are unary operators in C?a.!b.sizeofc.~d.&&e.=

#include<stdio.h>void main(){

static int a[20];int i = 0;a[i] = i++;printf(“%d%d%d”,a[0],a[1],i);

}

#include<stdio.h>void main(){

int I = 3;i = i++;printf(“%d”,i);

}

#include<stdio.h>void main(){

int x = 4,y,z;y = --x; z = x--;printf(“%d%d%d”,x,y,z);

}

#include<stdio.h>void main(){

int x = 55;printf(“%d%d%d”,x<=55,x=40,x>=10);

}

#include<stdio.h>#define SQR(x) (x * x)void main(){

int a, b =3;a = SQR(b+2);printf(“%d”,a);

}

#include<stdio.h>void main(){

int arr[1] = {10};printf(“%d”, 0[arr]);

}

If the array begins at address 1200 in memory, what will be the output of the program?

#include<stdio.h>void main(){

int a[] = {1,2,3,4,5};printf(“%u%u%u”,arr,&arr[0],&arr);

}

#include<stdio.h>void main(){

float a[] = {1.2,2.4,3.5,4.5};printf(“%d”, sizeof(a) / sizeof(a[0]));

}

#include<stdio.h>void main(){

printf(“%c”, “abcdefgh”[4]);}

#include<stdio.h>void main(){

printf(5 + “Fascimile\n”)}

o/p : mile

#include<stdio.h>void main(){

int I;printf(“%d”, scanf(“%d”,&i));

}

#include<stdio.h>void main(){

char p[] = “%d\n”;p[1] = ‘c’;printf(p,65);

}

#include<stdio.h>void main(){

char str[10] = “Angel”;str[6] = ‘d’;printf(“%s”,str);

}o/p : Angel

#include<stdio.h>void main(){

char str[] = “Sales\0man\0”;printf(“%s”,str);

}o/p : Sales