Write a c program to demonstrate Type casting in c?
Answers were Sorted based on User's Feedback
Answer / shivakumar
#include <stdio.h>
int main()
{
for ( int x = 0; x < 256; x++ ) {
/* Note the use of the int version of x to output a
number and the use
* of (char) to typecast the x into a character
which outputs the
* ASCII character that corresponds to the current
number
*/
printf( "%d = %c\n", x, (char)x );
}
getchar();
}
Is This Answer Correct ? | 11 Yes | 2 No |
Answer / pinkey
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=4,c;
c=short(a+b);
printf("%d",c);
getch();
}
Is This Answer Correct ? | 7 Yes | 5 No |
how can i calculate mean,median,mode by using c program
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
How can I open files mentioned on the command line, and parse option flags?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
what is the c source code for the below output? 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1
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!
What is sizeof array?
Write a program in c to print * * * * * *******
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 the Purpose of 'extern' keyword in a function declaration?
What are the complete rules for header file searching?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.