C Language
Description: programming tricks and concept based problems.. | |
Number of Questions: 14 | |
Created by: Preeti Dasgupta | |
Tags: programming and theory Compiler Design Java/Oracle /C/C++ Programming - C / C++ Programming and Data Structures Pointer Array |
There are some rules for declaring a variable in C language. Which of the following rules is/are not correct for declaring variables?
Which of the following conversion symbols used in printf statements in C language is/are invalid?
How many keywords are there in ANSI C?
Which of the following statements is/are true?
#include<stdio.h> #include<conio.h> int main() { int a=9,b=10,c; c=(b<a || b>a); printf(c=%d,c); getch(); }
Find the output of the above program or error, if any.
If x = 9.3, y = x - 5.1, z = x - 0.2, k = y + 1.5, a = k + 2.2, b = a - 1.6, h = z + 2.8, u = 625 / 25 and t = 7, then solve the following expression according to the precedence. P = (x - y + z / k - a / b - h + u % t).
#include<stdio.h> #include<coni.h> int main() { unsigned long v=-1; printf(v=%lu,v); getch(); }
Find the output of the above program or error, if any.
C language has some special characters. Which of the following special characters is invalid?
What will be the value of c after the execution of the following program? #include<stdio.h> #include<conio.h> int main() { int c=1,d=0; while(d<=9) { printf( %d%d,++d,++c); } getch(); }
Which of the following statements is correct for the given program? #include<stdio.h> #include<conio.h> int main() { int a1,a2,c=3,pt; pt=&c; a1=3(c+5); a2=3*(*pt+5); printf(a1=%d,a2=%d,a1,a2); getch(); }
What will be the output of the given program? #include<stdio.h> #include<conio.h> int main() { char x='G'; switch(x) { if(x=='B') { case 'd': printf(%c,'o'); case 'B': printf(%s,Bad); } else { case 'G': printf(%s,Good); default: printf(%s,Boy); } } getch(); }
The C programs are converted into machine language using a/an ____________.
Find out the values of variables a and b after the execution of program or find out the error if any. #include<stdio.h> #include<conio.h> int main() { int a,b=&a,c=&b; a=5; **c=15; *b=*c; printf(a=%d,b=%d,a,*b); getch(); }
Find out the output of the given program or find the error if any. #include<stdio.h> #include<conio.h> int main() { int s=25,d; d=s%10; if(d==5) { s=s/10; printf( result is=%d%d,s*s++,d*d); } else { printf( invalid number); } getch(); }