Input data
The program does not require any function.
Output data
The program must have at least one function.
Martin Richards
Dennis Ritchie
Ken Thompson
Herman Hellorith
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
1
2
4
8
Id_No
ID_NO
IdNo
Id No
What will be the output of following program?
int main() { for(int c=1;c<5;++c); printf(“%d”,c); }
5
6
12345
Consider the following code and How many bytes of memory will be allocated?
int *ptr = (int *)malloc(10 * sizeof(int));
10 bytes
20 bytes
80 bytes
40 bytes
final
constant
const
static
int number;
float rate;
int variable_count;
int $main;
In the following nested conditional statements, which branch will execute?
int x = 4;if (x > 2) { if (x < 5) { printf("x is between 2 and 5"); }} else { printf("x is 2 or less");}
x is between 2 and 5
x is 2 or less
Error
No output
no of students
char
7th
myName
void
endl
float
switch
Find the output of following code :
int main() { int i=-2; printf (“-i=%d”,-i); return b; }
–i=2
i=-2
–i=-2
–i=+2
Binary operator
Unary operator
Ternary operator
All of the above
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
“programming Trick”
“programming"
‘programming'
$ programming $
-1
0
auto
case
main
default
What will be the output of the following pseudo code ?
Integer aSet a =4do print a + 2 a = a-1while (a not equals 0)end while
6 6 6 6
6 5 4 3
6 7 8 9
6 8 10 12
&&
| |
!
It returns the size of the variable in bits
It returns the size of the variable in bytes
It returns the size of the variable in kilobytes
It returns the number of elements in an array
Null
EOF
it Compare the variable a and the variable b are same.
The value of b is assigned to variable a but if b changes later, it will not effect the value of variable a.
The value of b is assigned to variable a but if b changes later, it will effect the value of variable a.
The value of variable a is assigned to variable b, and the value of variable b is assigned to variable a.
What is the output of the following code?
main(){ int a, b; a=b=4; b=a++; printf("%d %d %d %d", a++, --b, ++a, b--);}
5 3 7 3
Syntax error
5 4 5 3
6 2 6 4
int a = 5;printf("%d", a == 5);
Undefined
Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
Compiler
Interpreter
Assembler
None of These
Stack
CISC
RISC
Parallel
for (int i = 0; i < 10; i++)
for i = 0 to 10 step 1
for (i = 0; i < 10; i++)
for (i < 10; i++)
ctype.h
stdio.h
conio.h
math.h
&
||
start()
printf()
main()
getch()
What will be the output of the following program?
int main() { int x=5; printf(“%d %d %d”,x,x<<2,x>>2); }
1 20 5
5 1 20
5 20 1
20 1 5
* / % + - =
= * / % + -
/ * % - + =
* % / - + =
Infinitely
Variable
Depends on the system
float, double
short int, double, long int
float, double, long double
double, long int, float
break
continue
return
None of these
Return
GOTO
Switch
exit
signed short
unsigned short
long
int
double
What is the output of the following code:
int x = 5;
printf("%d", x++);
int arr[10][10];
int arr[10,10];
array int arr[10][10];
int arr{10}{10};
put together the file and functions that are required by the program
translate the instructions into a form suitable for execution by the program
load the executable code into the memory and execute them
allow the user to type the program
int arr[5] = {1, 2, 3, 4, 5};printf("%d", arr[3]);
3
include
16
2 bytes
4 bytes
8 bytes
1 byte
Constants
Keywords
Operators
Tokens
int x = 5;if (x > 3) { printf("Greater than 3"); } else { printf("Not greater than 3"); }
Greater than 3
Not Greater than 3
No Output