To declare and initialize character array :
char s[] = { 'a', 'b' , 'c' };
char s[] = "abc";
both correct
both wrong
What is the output of the following piece of code?
int x = 3, y = 5, z ; z = x++ + ++y; printf(ā%dā,z);
8
9
10
11
What is the role of variables in programming languages:
Perform standard functions like printing to the screen
Data storage
Both correct
Both wrong
what is the output of the following program
main(){ int x; printf(ā%dā,x); }
Unknown (random value)
Zero
3000
4000
float values(200) = ( 1 , 2 , 3 , 4 );
is correct
has syntax error
causes run-time error
none of the above
To write statement hi world:
puts('hi world');
puts("hi world");
The variables in C programming language:
Must be declared before being used.
Can be used without declaration
Can be used before declaration
consider the following statement:
while ( 3 ) ;
Infinite loop
Syntax error
Executes only 3 iterations
Executes only 4 iterations
To include a header file in a C program:
#include "stdio.h"
#include
what is the best choice to print the value of variable x where:
int x = 123;
printf("%f",x);
printf("%d",x);
printf("%c",x);
printf("%s",x);