Using string functions write a program that will accept the
name of the capital as input value and will display the
corresponding country.
------------------------
Capitals Countries
------------------------
Capitals Countries
Ottawa Canada
Moscow Russia
Rome Italy
I can't not get it to run properly
Answer / roxy
this is my code:
#include<stdio.h>
#include<string.h>
main()
{
char cc1[]={"OTTAWA"},
{"MOSCOW"},
{"ROME"};
char cc2[]={"CANADA"}
{"RUSSIA"}
{"ITALY"};
char a;
clrscr();
printf("Enter Capital: ");
scanf("%s",&cc1);
a=strcmpi(cc1,cc2);
strncpy(cc2,cc1,[1]);
if(a==0)
{
printf("\nThe capital of %s is %s",cc1,cc2);
}
if(a==1)
{
printf("\nThe capital of %s is %s",cc1,cc2);
}
else(a==2)
printf("\nThe capital of %s is %s",cc1,cc2);
getch()
}
| Is This Answer Correct ? | 13 Yes | 84 No |
quoroum of computer languages?
loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplaced continue. Doubt-1.will the exit(x) be executed for all values of x 2.will this statement go out of the program.
void main() { int i=7; printf("N= %*d",i,i); }
main() { char c; for(c='A';c<='Z';c++) getch(); }
A sample program using data structure? what is file handling?
errors are known as?
3 Answers EX, State Bank Of India SBI,
Assume that the int variables i and j have been declared, and that n has been declared and initialized. Write code that causes a "triangle" of asterisks of size n to be output to the screen. Specifically, n lines should be printed out, the first consisting of a single asterisk, the second consisting of two asterisks, the third consistings of three, etc. The last line should consist of n asterisks. Thus, for example, if n has value 3, the output of your code should be * ** *** You should not output any space characters. Hint: Use a for loop nested inside another for loop.
how to convert decimal to binary in c using while loop without using array
50 Answers Apple, Aptech, Arwen Tech, BCS, C2D Software, CEC,
Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.
what is run time error?
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;