Which of the following operators cannot be overloaded in c++? A) ?: b)[] c) - d) none of these
what is the output? int i=7 printf("%dn",i++*i++);
i++=8
i++*i++=64
56 bcoz ++ operator precedence is right to right.......
Uniform resource Locator
Universel Resource Locator
A financial year is start from 1 april of every year and end on 31 march of next year. Write a C program to find number of months and number of days between two dates in a given financial year. E.G if d1=5/4/2012 and d2=23/2/2013 are given, find the no. Of days between these two dates.
The days between 05/04/2012 and 23/02/2013 are 323 days
the binary equivalent of 188 is
The answer is 10111100
10111100
Main() { int a[]={0 1 2 3}; int *b; b=&a[2]; printf("%d",b[-1]); } technical interview
B. non-primitive datastructures
answer- stack and queue are non linear data structures
the protocol used to transfer web pages a. Http b. Ftp c.Tcp/ip
A.HTTP
it is used to display web pages from one place to another place
A. HTTP
what is the output of the program? int n=f,m; n==m++; m==++n; printf(n, m);
Error, undefinrd symbol f..
"n=m m=1+n"
Code
"n=m m=1+n"
What are the 4 programminglanguages that hp uses?
A) dropmem() b) dealloc() c) release() d) free()
d) free()
d) free()
a
language independence
A. Language Independence
which key in any windows screen is used to invoke file menu?
alt+f
F10 AND ALT+F
alt+f
Explain the concept of unary and binary operator overloading giving suitable examples.
unary operator takes a single operand..exampleof (incerement ++ and decrement -- operators).unary also classified as 1.simple prefix unary operator ,example the (-)minusoperator 2.pre and post increme...
Please guys, check your answer before, I saw many of them wrong on this website. The above "binary operators" description should say this: (++ and -- are Unary by the way....) The binary operators ...
How will you remove a file with the name '-somethink'?
rm /-somethink
Kernel executes the first process when system starts
Ans :- init();
In Linux perspective a system start up flow of control is as follows: 1. BIOS :- Performs basic power on test which initializes CPU, RAM, had disk, mouse, keyboard, video display etc. 2. Boot Loader :...
Which hardware implements stack operation in 8085/8086
A. Rom b. Prom c. Ram d. None of these answer:c.Ram
C. RAM.
To confirm just check memory allotment for 8085.
Write a function to find how many binary 1s nd 0s present in a number
Code
#include<stdio.h> int main() { int no,i,count =0; scanf("%d",&no); for(i =0,i<16;i++) { if((no & 0x8000) == 0x8000) count++; no = no << 1; } // end of loop return 0; } //main function end<pre>Code
#include<stdio.h></span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "><span style="color: #993333 ">int</span> main<span style="color: #009900 ">(</span><span style="color: #009900 ">)</span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> <span style="color: #009900 ">{</span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> <span style="color: #993333 ">int</span> no<span style="color: #339933 ">,</span>i<span style="color: #339933 ">,</span>count <span style="color: #339933 ">=</span><span style="color: #0000dd ">0</span><span style="color: #339933 "> </span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066 ">printf</span></a><span style="color: #009900 ">(</span><span style="color: #ff0000 ">"enter a number"</span><span style="color: #009900 ">)</span><span style="color: #339933 "> </span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> scanf<span style="color: #009900 ">(</span><span style="color: #ff0000 ">"%d"</span><span style="color: #339933 ">,&</span>no<span style="color: #009900 ">)</span><span style="color: #339933 "> </span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> <span style="color: #b1b100 ">for</span><span style="color: #009900 ">(</span>i <span style="color: #339933 ">=</span><span style="color: #0000dd ">0</span><span style="color: #339933 ">,</span>i<span style="color: #339933 "><</span><span style="color: #0000dd ">16</span><span style="color: #339933 "> </span>i<span style="color: #339933 ">++</span><span style="color: #009900 ">)</span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> <span style="color: #009900 ">{</span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> <span style="color: #b1b100 ">if</span><span style="color: #009900 ">(</span><span style="color: #009900 ">(</span>no <span style="color: #339933 ">&</span> 0x8000<span style="color: #009900 ">)</span> <span style="color: #339933 ">==</span> 0x8000<span style="color: #009900 ">)</span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> count<span style="color: #339933 ">++ </span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> no <span style="color: #339933 ">=</span> no <span style="color: #339933 "><<</span> <span style="color: #0000dd ">1</span><span style="color: #339933 "> </span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> <span style="color: #009900 ">}</span> <span style="font-style: italic ">// end of loop</span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> </div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066 ">printf</span></a><span style="color: #009900 ">(</span><span style="color: #ff0000 ">"The number of 1 in %d is %d"</span><span style="color: #339933 ">,</span>no<span style="color: #339933 ">,</span>count<span style="color: #009900 ">)</span><span style="color: #339933 "> </span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "> </div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "><span style="color: #b1b100 ">return</span> <span style="color: #0000dd ">0</span><span style="color: #339933 "> </span></div></li> <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal "><span style="color: #009900 ">}</span> <span style="font-style: italic ">//main function end</span></div></li></ol></div></p></pre> Answered by: vasi7999 on: Jun 3rd, 2012The c program is as follows :
Code
#include<stdio.h> #include<conio.h> void main() { int a[10],n=0,o=0,z=0,l; clrscr(); Enter the number of digits in the given number : "); scanf("%d",&l); Enter the Binary number one by one: "); for(i=0;i<l;i++) { scanf("%d",&a[i]); } for(i=0 ; i<l ; i++) { n=a[i]; if(n==0) o++; else z++; } The Number of Zeros is : %d",z); The Number of Ones is : %d",o); getch(); }
(a) 1 (b) 0 (c) 2 (d) none
b) 0
zero
What is the output of the program?
Main() { char a='123' printf ("%c n",a); return 0; } a. Ascii value of 121 b. 1 c. 3 d. None of these
The answer is either 3 or its ascii value 51 depending on the compiler.
ANSWER:(A)ASCII Value of 123
a
B)[] and C)-