main()
{
extern int i;
{ int i=20;
{
const volatile unsigned i=30; printf("%d",i);
}
printf("%d",i);
}
printf("%d",i);
}
int i;
Answer / pavan_mustyala
1st printf o/p is 30
2nd printf o/p is 20
3rd printf o/p is 0
Reason: O/p depends on scope of variable.
| Is This Answer Correct ? | 8 Yes | 1 No |
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
String copy logic in one line.
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?
Cluster head selection in Wireless Sensor Network using C programming language.
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
Write a routine to implement the polymarker function
main() { extern out; printf("%d", out); } int out=100;
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }