#include"stdio.h"
#include"conio.h"
void main()
{
int a;
printf("\n enter a number:");
scanf("%c\n");
getch();
}
Answers were Sorted based on User's Feedback
Answer / janava
In this a variable is a integer but read the int as char so
it shows error.
this can be written as
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf("\n Enter a number");
scanf("%d",&a);
getch();
}
| Is This Answer Correct ? | 48 Yes | 13 No |
Answer / lalithpriya
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
clrscr();
printf("Enter a number:");
scanf("%d",&a);
printf("The entered number is %d",a);
getch();
}
| Is This Answer Correct ? | 13 Yes | 5 No |
Answer / r.kumar bsc
getting a value is defined %d that is scanf("%d\n");
this formatted is correct that %c is defined only is
getting the characters.
| Is This Answer Correct ? | 20 Yes | 14 No |
Answer / aarti
#include<stdio.h>
#include<conio.h>
void main
{
clrscr();
int number;
printf("\n enter a number:");
scanf("%d",&number);
getch();
}
| Is This Answer Correct ? | 9 Yes | 7 No |
Here in the scanf("%c\n");
it is just take a input. and, it will store that input
value anywhere.
it would be just garbage value. ok.........
nothing is output.
say, null pointer assignment.........
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / gaurav tyagi
there is a error in program because ""is use in headerfile
due to this compiler is search the conio.h&stdio.h file in current directory
note:<>is use to tell compiler find these file in system area
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / aarti
#include<stdio.h>
#include<conio.h>
void main()
{
int number;
clrscr();
printf("\n enter a number:");
scanf("%d",&number);
getch();
}
| Is This Answer Correct ? | 4 Yes | 4 No |
Answer / mohit
#include {studio h}
#include{conio h}
[void main]
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sansiri
it access the value but it doesnot assign for any variable
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / lodu
#INCLUDE<STDIO.H>
#INCLUDE<CONIO.H>
{
VOID MAIN()
{
INT X,Y,Z;
| Is This Answer Correct ? | 0 Yes | 1 No |
class test { int a; public: test(int b):a(b){} void show(){ cout<<a; } }; void main() { test t1; test t2(5); t1.show(); t2.show(); } }
Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j .
I'm having trouble with coming up with the correct code. Thank You!! The assignment was to write a program using string functions that accepts a price of an item and displays its coded value. The base of the keys: X C O M P U T E R S 0 1 2 3 4 5 6 7 8 9 Sample I/O Dialogue: Enter Price: 489.50 Coded Value: PRS.UX
char* f() return "hello:"; void main() {char *str=f(); }
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
void main() { int i=5; printf("%d",i+++++i); }
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
To generate the series 1+3+5+7+... using C program
How to create a program that lists countries capitals when country is entered? (Terribly sorry, I'm a complete novist to coding with C, am looking for inspiration and general tips on how to code and create this program.)
How to create a program that lists the capital country when told what the original country is? (Terribly sorry, I'm a novice programmer and would appreciate any help ;). Cheers, Alexxis
which typw of errors ? & how to solve it ?