Q. Write a program to generate a following structure?
@@@@@
@@@@@
@@@@@
@@@@@
@@@@@
Ans.
/* c program for symbol structure*/
#include<stdio.h>
#include<conio.h>
int main()
{
int num,r,c;
printf("Enter loop repeat number(rows): ");
printf("Enter loop repeat number(rows): ");
scanf("%d",&num);
for(r=1; num>=r; r++)
for(r=1; num>=r; r++)
{
for(c=1; c<=num; c++)
printf("@");
printf("\n");
}
getch();
getch();
return 0;
}
/************* OUTPUT **************
Enter loop repeat number(rows): 5
/************* OUTPUT **************
Enter loop repeat number(rows): 5
@@@@@
@@@@@
@@@@@
@@@@@
@@@@@
***********************************/
***********************************/
in this program after getch(); there is a semicolon mistake .. please correct it :)
ReplyDeleteThanks man for improving C programming Community.
DeleteDesign and develop a program to illustrate a combinational circuit with three inputs x, y, and z, and three outputs A, B and C. If the binary input is 0, 1, 2, or 3; the binary output is one greater than the input. If the binary input is 4, 5, 6, or 7; the binary output is one less than the input
ReplyDeletethe program is wrong no?
ReplyDeleteafter printf("@"); there should be a } closing bracket for the 2nd loop and a { and the 2nd for statement or else the output would be like this.
@
@
@
@
@
@
@
@
@
@
@
@
@
No,It is right.After for it only read one statement under for.so it is correct code.
Delete#include
Deleteint main()
{
int i=6,j;
for(;i>=1;i--)
{
for(j=1;j<=5;j++)
printf("&");
printf("\n");
}
return 1;
}
write an algorithm, draw a flowchart and develop C program. Create astructure student containing fields for roll no., class, year and total marks. create 10 student and store them in a file ... ple iska ans btao pls.. urgently
ReplyDelete