in one file global variable int i; is declared as static. In
another file it is extern int i=100;
Is this valid ?
Answers were Sorted based on User's Feedback
Answer / dipti
No its in valid as a static variable cannot be declared as extern.
The whole and entire purpose of static is to declare that a variable is private to the source file that it is declared in.
| Is This Answer Correct ? | 0 Yes | 0 No |
int i=0,j; j=++i + ++i ++i; printf(" %d",j);
There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?
When a c file is executed there are many files that are automatically opened what are they files?
Can one function call another?
How can I call a function with an argument list built up at run time?
What is sizeof int?
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)
question-how to run a c programme.
How do you list a file’s date and time?
#include<stdio.h> #include<conio.h> void main() {clrscr(); char another='y'; int num; for(;another=='y';) { printf("Enter a number"); scanf("%d",&num); printf("squre of %d is %d",num,num*num); printf("\nwant to enter another number y/n"); scanf("%c",&another); } getch(); } the above code runs only one time.on entering 'y' the screen disappeares.what can i do?
C passes By value or By reference?
5 Answers Geometric Software, Infosys,
f() { int a=2; f1(a++); } f1(int c) { printf("%d", c); } c=?