Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
Profile
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
Recent activity by shiva0
2
answers
1
#arrays
i write this program, during initialization of array i given the size as 11 means the number of elements stored in an array is 11. as we know array is not assigned a value of index 12 and above. but in in the program array a is initialized of index from 0 to 19,my question is how the array is ... i=0;i<20;i++) { a[i]=i+1; } for(i=0;i<20;i++) { printf("%d\n",a[i]); } }
i write this program, during initialization of array i given the size as 11 means the number of elements stored in an array is 11.as we know array is not assigned a value...
695
views
commented
Apr 7, 2019
Programming in C
programming-in-c
programming
array
memory-management
+
–
1
answer
2
#Dynamic memory allocation malloc
how to know how much size is allocated while dynamically allocating memory to the pointer variable with malloc. i just write the below code to know the size of ptr2 after dynamically allocating memory. i want the output is 10 but it is displaying as 2 as ... allocation failed"); else{ printf("size of *ptr2 is == %d\n",(sizeof(ptr2)/sizeof(int))); } }
how to know how much size is allocated while dynamically allocating memory to the pointer variable with malloc.i just write the below code to know the size of ptr2 after ...
680
views
commented
Apr 6, 2019
Programming in C
programming-in-c
memory-management
+
–
0
answers
3
malloc
queue->array = (int*) malloc(queue->capacity *sizeof(int)); What is queue->capacity * doing here?
queue->array = (int*) malloc(queue->capacity *sizeof(int));What is queue->capacity * doing here?
297
views
commented
Apr 6, 2019
Programming in C
programming-in-c
memory-management
+
–
3
answers
4
#userdefined Data type union in C
What is the output of the program? int main() { union a { int i; char ch[2]; }; union a u; u.ch[0] = 3; u.ch[1] = 2; printf("%d, %d, %d", u.ch[0], u.ch[1], u.i); return 0; }
What is the output of the program? int main() { union a { int i; char ch ; }; union a u; u.ch[0] = 3; u.ch = 2; printf("%d, %d, %d", u.ch[0], u.ch , u.i); return 0; }
470
views
commented
Apr 6, 2019
Programming in C
programming-in-c
datatype
+
–
1
answer
5
#operator precedence and associativity
#include<stdio.h> int x = 0; int f1() { x = 5; return x; } int f2() { x = 10; return x; } int main() { printf("%d \n", f1()); printf("%d \n", f2()); int p = f1() + f2(); printf("%d ", x); return 0; } what is the output when int p= f1()+f2(); is called and how this is came?????? thank you…!
#include<stdio.h int x = 0; int f1() { x = 5; return x; } int f2() { x = 10; return x; } int main() { printf("%d \n", f1()); printf("%d \n", f2()); int p = f1() + f2(); p...
825
views
asked
Mar 10, 2019
0
answers
6
c++,Exception,Base and derived class exception
#include<iostream> using namespace std; class Base {}; class Derived: public Base {}; int main() { Derived d; // some other stuff try { // Some monitored code throw d; } catch(Base b) { cout<<"Caught Base ... base class exception is caught can anyone explain how it is happened internally . and what is class Derived: public Base {};
#include<iostream using namespace std; class Base {}; class Derived: public Base {}; int main() { Derived d; // some other stuff try { // Some monitored code throw d; } c...
708
views
asked
Feb 9, 2019
Programming in C
programming-in-c
exception-handling
+
–
1
answer
7
c programming ,data types
what is the output???? and how it internally converted to int when we are printing with %d format specifier?? when i run in my ide i got 50 as output and i donn’t know how it came? can anyone explain how 50 came #include <stdio.h> int main() { char a = '12'; printf("%d", a); return 0; }
what is the output???? andhow it internally converted to int when we are printing with %d format specifier??when i run in my ide i got 50 as output and i donn’t know ho...
383
views
commented
Jan 26, 2019
Programming in C
programming
programming-in-c
+
–
1
answer
8
data types
what is the output of the following programming???? and am confusing is unsigned int stores signed integer, and what is ~ ' this symbol ?? and what happened when assigning ~0' to y????? and what will be printed when x,y are printing and how ? can anyone tell me ... printf("same"); else printf("not same"); printf("\n x is %u, y is %u", x, y); return 0; }
what is the output of the following programming????and am confusing is unsigned int stores signed integer, and what is ‘ ~ ’ this symbol ?? and what happened when ass...
456
views
commented
Jan 25, 2019
Programming in C
programming
+
–
1
answer
9
programming
what is the reason…..?for error..
what is the reason…..?for error..
325
views
comment edited
Jan 22, 2019
Programming in C
programming-in-c
programming
+
–
0
answers
10
linkage in C
Can Anyone give a Best example for Internal and External Linkage in c/c++ I know what is internal and external linkage but still am confusing about what is the Translation Unit ,file ,Program. Internal Linkage:The variables which are accessed only inside the file( ... If anyone gives a better example describing each term with full code it will be helpful to me thank you ..!
Can Anyone give a Best example for Internal and External Linkage in c/c++I know what is internal and external linkage but still am confusing about what is the Translation...
240
views
asked
Jan 21, 2019
Programming in C
programming-in-c
programming
+
–
1
answer
11
c programming Files
#include<stdio.h> int main() { FILE *fp[2]; if((fp[0]=fp[1]=fopen("test.txt","w"))!=NULL) //test.txt file should be empty during first compiling { fputs("one",fp[0]); fclose(fp[0]); fputs("two",fp[1]); ... is done after fputs("one",fp[0]); and fputs("two",fp[1]); can anyone tell me with explanation...please .
#include<stdio.h>int main(){ FILE *fp ; if((fp[0]=fp =fopen("test.txt","w"))!=NULL) //test.txt file should be empty during first compiling { fputs("one",...
465
views
commented
Jan 20, 2019
Programming in C
programming-in-c
output
programming
+
–
0
answers
12
c programming
int main() { int a=2,b=2,c=2; printf("%d",a==b==c); return 0; } what is the output??? and what will be done during execution can anyone explain this……...
int main(){ int a=2,b=2,c=2; printf("%d",a==b==c); return 0;}what is the output??? and what will be done during executioncan anyone explain this……...
454
views
closed
Jan 19, 2019
Programming in C
output
programming-in-c
strings
+
–
0
answers
13
UGC-NET CS 2016 question
Given i= 0, j = 1, k = – 1 x = 0.5, y = 0.0 What is the output of given ‘C’ expression ? x * 3 & & 3 || j | k explanation please….
Given i= 0, j = 1, k = – 1x = 0.5, y = 0.0What is the output of given ‘C’ expression ?x * 3 & & 3 || j | kexplanation please….
393
views
asked
Jan 19, 2019
Programming in C
relational-calculus
+
–
0
answers
14
programming
what is the use of void in main(void)? my code is: #include <stdio.h> #include <conio.h> int main(int argc,char *argv[]) { int i; if( argc >= 2 ) { printf("The arguments supplied are:\n"); for(i = 1; i < argc; i++) ... main(void) the program should not take any value .. anyone please tell me what is the reason and what is the use of void in the main(void)
what is the use of void in main(void)?my code is:#include <stdio.h>#include <conio.h>int main(int argc,char *argv[]) { int i; if( argc >= 2 ) { printf("Th...
207
views
edited
Jan 16, 2019
0
answers
15
programming
is *ptr=&a is true in C i found this in can anyone explain what does *ptr = &i; in the above picture
is *ptr=&a is true in Ci found this incan anyone explain what does *ptr = &i; in the above picture
848
views
commented
Jan 14, 2019
Programming in C
programming
output
programming-in-c
+
–
0
answers
16
programming
#include<stdio.h> #include<string.h> int main() { char fullname[]="abcd"; char firstname[]="xxxxx"; //char lastName[]='Nagula'; printf("enter number\n"); printf("Press 1 for fullname\n"); printf("Press 2 for ... :invalid initialiser in line char name[]= ( a==1 ? fullname : firstname); how to correct it. thank you..!
#include<stdio.h>#include<string.h>int main(){ char fullname[]="abcd"; char firstname[]="xxxxx"; //char lastName[]='Nagula'; printf("enter number\n"); ...
302
views
asked
Jan 13, 2019
Programming in C
programming-in-c
programming
output
+
–
1
answer
17
programming
#include<stdio.h> #define A -B #define B -C #define C 5 int main() { printf("The value of A is %dn", A); return 0; } what is the output?????
#include<stdio.h #define A -B #define B -C #define C 5 int main() { printf("The value of A is %dn", A); return 0; }what is the output?????
376
views
commented
Jan 12, 2019
Programming in C
programming
output
+
–
1
answer
18
programming doubt
#include<stdio.h> int main() { int i = 1; printf("%d %d %d\n", i++, i++, i); return 0; } on running i m getting answer : 2 1 3 why answer cant be 1 2 3
#include<stdio.h>int main(){ int i = 1; printf("%d %d %d\n", i++, i++, i); return 0;} on running i m getting answer : 2 1 3 why answer cant be 1 2 3
7.2k
views
commented
Jan 12, 2019
0
answers
19
geeksforgeeks
#include int main() { int i = 1; printf("%d %d %d\n", i++, i++, i); return 0; }
#include int main() { int i = 1; printf("%d %d %d\n", i++, i++, i); return 0; }
651
views
commented
Jan 12, 2019
Programming in C
programming-in-c
+
–
2
answers
20
c program output
#include<stdio.h> main() { char c = 'A'+255; printf("%c", c); }
#include<stdio.h main() { char c = 'A'+255; printf("%c", c); }
857
views
commented
Jul 20, 2018
Others
programming-in-c
output
explanation
please
+
–
2
answers
21
C programming
#include <stdio.h> main() { char *p = "Sanfoundry C-Test"; p[0] = 'a'; p[1] = 'b'; printf("%s", p); }
#include <stdio.h main() { char *p = "Sanfoundry C-Test"; p[0] = 'a'; p = 'b'; printf("%s", p); }
2.2k
views
commented
Jul 19, 2018
Others
programming-in-c
pointers
+
–
2
answers
22
c program output
#include <stdio.h> main() { char *p = 0; *p = 'a'; printf("value in pointer p is %c\n", *p); }
#include <stdio.h>main(){char *p = 0;*p = 'a';printf("value in pointer p is %c\n", *p);}
4.5k
views
asked
Jul 18, 2018
Others
programming-in-c
output
explanation
please
+
–
0
answers
23
c program
#include<stdio.h> int main() { int i=0; for(printf(" one\n "); i < 3 && printf(" "); i++) { printf("Hi!\n"); } return 0; }
#include<stdio.h>int main(){ int i=0; for(printf(" one\n "); i < 3 && printf(" "); i++){ printf("Hi!\n");}return 0;}
1.4k
views
commented
Jul 14, 2018
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register