what will be the output of the following program, justify?
#define TEST
int TEST getdata()
{
static i;
i+=10;
return i;
}
main()
{
int k;
k = getdata();
}
Answers were Sorted based on User's Feedback
Answer / rama krishna sidhartha
Since there is no output statement in this program there
output will not be displayed.
The output statement must be as follows :
printf("%d",k);
Then the output will be 10.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / aditya
there is no print statement and hence there is no output.
If at all k is printed it will be 10.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rkr
The Static variable is initialized to zero
In the above program
static i; which is equivalent to static i = 0;
Next line i is incrementing by 10, then i value is 10.
return the value is 10
Is This Answer Correct ? | 1 Yes | 2 No |
what is diff b/w huge & far & near pointer??
What is the most efficient way to count the number of bits which are set in an integer?
In which mode we open the file for read,write and append also in c ? a)W b)w+ c)r+ d)a
What is ponter?
#include<stdio.h> main() { int a=1; int b=0; b=++a + ++a; printf("%d %d",a,b); }
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
What is #define?
Just came across this question, felt worth sharing, so here it is I want you to make a C/C++ program that for any positive integer n will print all the positive integers from 1 up to it and then back again! Let's say n=5 I want the program to print: 1 2 3 4 5 4 3 2 1. Too easy you say? Okay then... You can ONLY USE: 1 for loop 1 printf/cout statement 2 integers( i and n) and as many operations you want. NO if statements, NO ternary operators, NO tables, NO pointers, NO functions!
Why isn't any of this standardized in c? Any real program has to do some of these things.
sir i wanted to know how we wap in c to add numbers without using arithmetic operator in which digits are entered by user?
write a programming in c language, 1 3 5 7 9 11
Can an array be an Ivalue?